Solved

Warning message help required

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Ho to creat split-view application in iPad that display PDF file?? 3 151
C: GetDiskFreeSpaceEx() for default drive 14 107
mixing C++ and C code elegantly 10 156
outlook office 365 8 119
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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 nested-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.

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now