I have been learning C back from basics. Recently i tried out a simple program myHello.c , which contained the following code :
- int main(void)
- return 0;
next, i created hello.h that contained the following code :
- void hello(const char* name);
Finally i created helloFunc.c that contained the declaration for hello() :
- void hello(const char* name)
- printf("hello, %s \n",name);
I compiled the C sources as follow :
gcc -Wall myHello.c helloFunc.c -o newHello
I received the following error :
/usr/lib/gcc/i486-linux-gnu-4.3.3/../../../../libcrt1.o: In function '_start' :
/build/buildd/libc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined reference to 'main'
collect2: ld returned 1 exit status
i tried googling , but couldnt get a satisfying solution ! please help !