This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
mudflapth - undefined symbol: main
- From: John Carter <john dot carter at tait dot co dot nz>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 14 Mar 2008 11:10:41 +1300 (NZDT)
- Subject: mudflapth - undefined symbol: main
I'm trying to get mudflap going on i686-pc-linux-gnu-gcc (GCC) 4.2.3
I use -fmudflapth on compiling and linking and -lmudflapth on linking.
When I run it I get....
LD_LIBRARY_PATH=/opt/i686-pc-linux-gnu/lib:/usr/lib:/lib ~/ffoo
/home/johnc/ffoo: symbol lookup error: /opt/i686-pc-linux-gnu/lib/libmudflapth.so.0: undefined symbol: main
If I try to statically link it ( -static) I get many warnings...
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getgrgid':
mf-hooks2.c:(.text.__mfwrap_getgrgid+0xc): warning: Using 'getgrgid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getgrnam':
mf-hooks2.c:(.text.__mfwrap_getgrnam+0x71): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getpwnam':
mf-hooks2.c:(.text.__mfwrap_getpwnam+0x71): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getpwuid':
mf-hooks2.c:(.text.__mfwrap_getpwuid+0xc): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_gethostbyname':
mf-hooks2.c:(.text.__mfwrap_gethostbyname+0x60): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getprotobynumber':
mf-hooks2.c:(.text.__mfwrap_getprotobynumber+0xc): warning: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getprotoent':
mf-hooks2.c:(.text.__mfwrap_getprotoent+0x5): warning: Using 'getprotoent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getprotobyname':
mf-hooks2.c:(.text.__mfwrap_getprotobyname+0x70): warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getservbyname':
mf-hooks2.c:(.text.__mfwrap_getservbyname+0xeb): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getservbyport':
mf-hooks2.c:(.text.__mfwrap_getservbyport+0x79): warning: Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/i686-pc-linux-gnu/lib/libmudflapth.a(mf-hooks2.o): In function `__mfwrap_getservent':
mf-hooks2.c:(.text.__mfwrap_getservent+0x5): warning: Using 'getservent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
but it seems to run. Any suggestions on how to get rid of the warnings
or get the dynamically linked version running?
The .o and the statically link executable it has a "main".
Looking in the dynamically link executable with nm --extern I see main is indeed missing.
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand