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