Solved

Warning message help required

Posted on 1998-12-13
5
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 100 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

636 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