This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Undefined Reference Problems During Link Of Simple Program


Hello Everyone,

When creating a simple HelloWorld executable I get undefined reference link 
errors from the lib3rdparty shared library that the executable uses. I have 
included in this post complete output from my compile and link, but the 
short of it is link errors that look like this...

./lib/lib3rdParty.so: undefined reference to `wcschr@SUNW_0.8'

Several link errors like above occur. I don't know what is going on because 
the functions that I am getting the error for are in /usr/lib/libc.so, which 
is being included in the link. I suspect it has something to do with the 
extra "@SUNW_0.x" stuff, but am running out of ideas.

I am using GNU GCC 2.95.3 and GNU LD 2.11.2 on a Solaris7 system.

Thanks.

x1x82

[/home/x1x82]$g++ -c -o HelloWorld.o HelloWorld.cpp
[/home/x1x82]$g++ --verbose -t -L./lib -l3rdparty -o HelloWorld HelloWorld.o
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/specs
gcc version 2.95.3 20010315 (release)
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/collect2 -V -Y 
P,/usr/ccs/lib:/usr/lib -Qy -o HelloWorld -t 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crt1.o 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crti.o 
/usr/ccs/lib/values-Xa.o 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtbegin.o -L./lib 
-L/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3 
-L/usr/local/sparc-sun-solaris2.7/lib -L/usr/ccs/bin -L/usr/ccs/lib 
-L/usr/local/lib -l3rdParty HelloWorld.o -lstdc++ -lm -lgcc -lc -lgcc 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtend.o 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtn.o
./lib/lib3rdParty.so: undefined reference to `wcschr@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `wcsrchr@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `wcscoll@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `towlower@SUNW_0.7'
./lib/lib3rdParty.so: undefined reference to `towupper@SUNW_0.7'
./lib/lib3rdParty.so: undefined reference to `wcspbrk@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `wcsspn@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `wcsncpy@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `wcscspn@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `wcslen@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `wcsncmp@SUNW_0.8'
./lib/lib3rdParty.so: undefined reference to `iswspace@SUNW_0.7'
/usr/local/sparc-sun-solaris2.7/bin/ld: link errors found, deleting 
executable `HelloWorld'
GNU ld version 2.11.2 (with BFD 2.11.2)
  Supported emulations:
   elf32_sparc
   elf64_sparc
/usr/local/sparc-sun-solaris2.7/bin/ld: mode elf32_sparc
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crt1.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crti.o
/usr/ccs/lib/values-Xa.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtbegin.o
-l3rdParty (./lib/lib3rdParty.so)
HelloWorld.o
-lstdc++ (/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/libstdc++.so)
-lm (/usr/lib/libm.so)
-lc (/usr/lib/libc.so)
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtend.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtn.o
collect2: ld returned 1 exit status
I am using GNU GCC 2.95.3 and GNU ld 2.11.2 on a Solaris7 system.








_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]