collect2: ld returned 1 exit status

Yuen Sin Cheong yuensin78@hotmail.com
Wed Sep 27 13:51:00 GMT 2006


Dear All,

I tried to compile a program but I got the following error message:

/usr/lib64/gcc/x86_64-suse-linux/4.0.2/../../../../lib64/crt1.o: In function 
`_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
collect2: ld returned 1 exit status

Any advice on what might be the cause of this error is greatly appreciated.

I did the compilation on SuSE 10 Linux as follows:

g++ program.cpp -o program.so

Many thanks for your help.

Regards,
Yuen.




More information about the Gcc-help mailing list