Solved

Warning message help required

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
posix semaphore deadlock 13 108
mixing C++ and C code elegantly 10 150
Problem in finding output of a program 11 93
chcp 65001 File encoding 66 218
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…
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…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
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.

758 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

19 Experts available now in Live!

Get 1:1 Help Now