Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding what they mean????

Status
Not open for further replies.

crymedry

MIS
Nov 19, 2003
54
i am using bloodshed dev c++ compiler, and i keep getting error codes that i have no idea what they are telling me ... is there somewhere i can go to find this info, it isn't on their website

thanks
 
Most messages are pretty self explanatory

Perhaps if you post some code and the error messages you are getting, we can help.

--
 
ok, this is pretty rediculous, but
the code is:
main()
{
printf("blah blah blah\n");
}

and the error is:
implicit declaration of function 'int printf(...)'

i can't figure it out

any help would be great
thanks
 
"implicit declaration"
Meaning the compiler made a guess based on the available evidence provided by your use of the function.
That is, the compiler implied a declaration from your usage.

You then go read the manual to find out where printf is declared (stdio.h) and you add this to your program.
You then have an explicit declaration for printf

Code:
#include <stdio.h>
int main ( ) {
    printf( &quot;hello world\n&quot; );
    return 0;
}

--
 
it worked .... hoorah!

thank you, now where can i get a manual for a comiler that tells me these things if it is not on the developer's website?

thanks
 
Hi,
Most any C++ compiler has the same error messages.

typically there are other people on the WEB with your same problem. go to your favorite search engine type in

&quot;implicit declaration&quot; C++ printf

or whatever other error message you have and you will get hits.

one of my hits took me to

C for the C++ or Java programmer

I searched for implicit on the web page and it show'd....


Compile this with:
g++ -o fact0.x fact0.c
We get the following error:
fact0.c: In function `int getInt()':
fact0.c:25: implicit declaration of function `int malloc(...)'
fact0.c:32: implicit declaration of function `int atoi(...)'

We can read the man pages for malloc and atoi from the Unix command line:
man malloc
man atoi

The man pages tell us that we need to add #include <stdlib.h> to the beginning of our C program
The modified file, fact1.c compiles without error
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top