[PLUG] C programming

Terry Griffin griffint at pobox.com
Thu Aug 28 00:20:21 UTC 2008


> 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:~$
>
>

This should take care of the printf warning:

#include <stdio.h>

main(){
    printf("hello, world.\n");
}






More information about the PLUG mailing list