grajea01
February 1st, 2006, 12:58 AM
Hello,
It seems to be a frequently-reported problem, according to good ole Google, but I haven't seen any solution yet. Strangely according to google no one reported it on this forum :
While I compile a simple C++ app on my AMD64 with GCC 4.0.2 on Ubuntu 5.10 I get this:
---
g++ -L/usr/local/mysql/lib -lmysqlclient -lz -lcrypt -lnsl -lm -lstlport -o addServer-linux
/usr/lib/gcc/x86_64-linux-gnu/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
make: *** [all] Error 1
---
The undefined reference has been reported at many places, but as I said, I couldn't find any workaround this.
This program is being ported from a Sun Ultra 10 running Solaris 10 and using SunStudio 11. No code modification has been necessary, only on the Makefile. I'm saying this to show that the code is not an issue here. It clearly seems to be a linker issue -unless I'm being badly mistaken ?
Anyway.. anyone got a way to go pass this vexing problem ?
Regards,
Jeff
It seems to be a frequently-reported problem, according to good ole Google, but I haven't seen any solution yet. Strangely according to google no one reported it on this forum :
While I compile a simple C++ app on my AMD64 with GCC 4.0.2 on Ubuntu 5.10 I get this:
---
g++ -L/usr/local/mysql/lib -lmysqlclient -lz -lcrypt -lnsl -lm -lstlport -o addServer-linux
/usr/lib/gcc/x86_64-linux-gnu/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
make: *** [all] Error 1
---
The undefined reference has been reported at many places, but as I said, I couldn't find any workaround this.
This program is being ported from a Sun Ultra 10 running Solaris 10 and using SunStudio 11. No code modification has been necessary, only on the Makefile. I'm saying this to show that the code is not an issue here. It clearly seems to be a linker issue -unless I'm being badly mistaken ?
Anyway.. anyone got a way to go pass this vexing problem ?
Regards,
Jeff