Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Warning message help required

Posted on 1998-12-13
5
Medium Priority
?
206 Views
Last Modified: 2010-04-15
Hi
 could someone suggest how to get rid of the following warning messages that keeps appearing when I'm compiling my C files :
"warning C4013: 'system' undefined; assuming
 extern returning int"
"warning C4013: 'getDate' undefined; assuming
 extern returning int"

The system message seems to be because I'm using the following line of code : system("cls");

Any ideas of where I'm going wrong

Best regards
John



0
Comment
Question by:tam97
  • 2
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 400 total points
ID: 1255087
You should #include <system.h> to make 'system()' known to the compiler ...
The warning concerning 'getDate()' seems also to be due to a missing header file (though i have to admit that i don't know which one, as this func - with an uppercase(!) 'D' - is not known to me...)
0
 
LVL 86

Expert Comment

by:jkr
ID: 1255088
Ooops - sorry, i of course meant '#include <process.h>' - sorry ;-)
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1255089
The warnings appear because the compiler has not seen an appropriate declaration of these two functions.

C assumes function that are not delcared are functions returning int (yuck).

You either need to #include a header file that declares these functions in your .c source file or declare them manually yourself.  If they are function in a library (like system probably is) then delcaring it yourself is a BAD idea.  If it is a function you have written yourself then you should right your own .h file to include or put the declaration into the source file.

NOTE: if you use a function before it is declared in a source file, then you will get that sort of message as well.  Either declare your functions earlier, or rearrange them so the definition appears before the first call.

0
 

Author Comment

by:tam97
ID: 1255090
Hi Ronslow

Thanks for your comment, we got the problem sorted it was due to our bad coding.

Thanks again

Rgds John
0
 

Author Comment

by:tam97
ID: 1255091
Hi Jkr

As stated in the reply back to Ronslow, the getDate warning was sorted out, it was down to bad coding on our part.

Your #include<process.h> solved our system messages of which there was quite a few, so that simple piece of info helped my Uni group not loose marks for compiling errors.

You'd think the uni lecturers would help us poor C beginners a bit more, thank goodness for a forum like this one.

Thanks for all your help and please accept the points for the question.

Best Regards John
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question