Linux.com

Author Message
Joined: Jul 30, 2007
Posts: 3
Other Topics
Posted Aug 18, 2007 at 4:15:35 PM
Subject: gcc's problems
e.c's source: main(){ int a; printf("%s","hello,world"); } I input these commands in bash: gcc -o e e.c infomation: e.c: In function ‘main’: e.c:4: warning: incompatible implicit declaration of built-in function ‘printf’ /usr/bin/ld: crt1.o: No such file: No such file or directory collect2: ld returned 1 exit status what should I do? any one can help me?
Back to top Profile Email Website
Bill R
Joined Aug 30, 2007
Posts: 1

Other Topics
Posted: Aug 30, 2007 8:21:09 PM
Subject: gcc's problems
You need to tell the compiler where to find the definition of the function printf. That is done by including the line #include <stdio.h> at the beginning of your source file.
Back to top Profile Email Website
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya