Solved

Warning message help required

Posted on 1998-12-13
5
191 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
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.

734 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