g++ linking problem with multiple libraries on solaris 2.7

Qiegang Long qlong@mindspring.com
Sat Jul 15 22:55:00 GMT 2000


Hi,
 
On Solaris 2.7 with gcc-2.9.5, I am having a strange problem 
with g++.
 
I have over 100 source files for  a library. If I 
compiled all the sources file and generate one big static library with "ar" 
command, 
my test program can be successfully linked to the 
library.  However,  if I organize those files into two sets, then use 
"ar" to generate
two static libraries, my test program cannot be linked 
successful with the two new libraries. The error  is some symbols in 
one
library cannot be resolved, although those symbols are defined 
in the other library. 
 
For example, I generated libex1.a and libex2.a, to link  
test program mytest, 
 
$ g++ -o mytest.o libex1.a libex2.a -L/usr/local/lib 
-lstdc++
 
the error is some symbols in libex2.a cannot be resolved, 
although those symbols are defined in libex1.a.
 
Is this a known problem? 
 
Any help is appreciated. 
 
Qiegang
 



More information about the Gcc mailing list