[PLUG] C programming

Michael Ewan mhewan1 at comcast.net
Thu Aug 28 01:00:57 UTC 2008


Daniel Johnson wrote:
> On Wed, Aug 27, 2008 at 4:59 PM, rich <t_rex at verizon.net> wrote:
>   
>> I copied a simple C program out of the Unbuntu book and when I tried to
>> compile it, I got an error message.  Does anyone know what the message
>> means and how to fix it?
>>
>> main(){
>>    printf("hello, world.\n");
>> }
>>
>> rich at rich-desktop:~$ gcc -o hello hello.c
>> hello.c: In function 'main':
>> hello.c:2: 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
>> rich at rich-desktop:~$
>>     
>
> Is that the whole file?  Are there any includes at the top?
> _______________________________________________
>   
You need
#include <stdio.h>
at the top, printf is defined there.


No virus found in this outgoing message.
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.6.9/1637 - Release Date: 8/27/2008 7:01 AM




More information about the PLUG mailing list