View Single Post
  #1 (permalink)  
Old July 25th, 2008, 02:23 PM
jch jch is offline
Registered User
 
Join Date: Jul 2008
Location: Queens, NY, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jch
Default I am having problems compiling Hello World program

HI, I Am new to the Linux OS and I would like someone to help me solve a problem that I am having.

I have written the first program in the book Begining inux Programming 3rd Edition. The source code is:

#include <stdio.h>

int main()
{
    printf("Hello World");
    exit(0);
}
It's a very simple program which I saved in my home directory as hello.c.

However, when I compile this program at the bash command line I get the following error message:

charles@linux:~> gcc -o hello hello.c
hello.c: In function ‘main’:
hello.c:6: warning: incompatible implicit declaration of built-in function ‘exit’

Is there something wrong with the program or could I be missing some libraries or development tools?