tam97
asked on
Warning message help required
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ooops - sorry, i of course meant '#include <process.h>' - sorry ;-)
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.
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.
ASKER
Hi Ronslow
Thanks for your comment, we got the problem sorted it was due to our bad coding.
Thanks again
Rgds John
Thanks for your comment, we got the problem sorted it was due to our bad coding.
Thanks again
Rgds John
ASKER
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
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