Jon
Jon

Reputation: 1705

Linking on Solaris with Developer Studio 12.5

I am experiencing some problems linking on Solaris 11.3 using Developer Studio 12.5.

The code appears to compile fine, but fails at the link stage:

CC  -o bin/libBlah.so -mt -G -z defs -fast -s -KPIC -xarch=generic \
-M mapfiles/solaris.map -library=stlport4 -staticlib=stlport4  \
<my .o files> <some boost .a libs> <openssl .a libs> \
-lCrun -lsocket -lnsl -lposix4 -lc -lm -lw -ldl

Undefined                       first referenced
symbol                             in file
void __Crun::ex_end_init()        obj/Blah.o
void __Crun::ex_start_init()      obj/Blah.o
ld: fatal: symbol referencing errors
gmake: *** [bin/libBlah.so] Error 2

If I remove the '-z defs' from the command line (link options), it will link fine. Running 'ldd libBlah.so' does not show any missing references.

A colleague used 'nm' to locate the symbols, which were only found in the static libCrun libs (not the shared libs):

# nm /opt/developerstudio12.5/lib/compilers/libCrun.so | grep ex_end_init
# nm /opt/developerstudio12.5/lib/compilers/libCrun.a | grep ex_end_init
00000340 T __1cG__CrunLex_end_init6F_v_

The manual advises using '-zdefs' to point out missing symbols, which we had done previously (makefile already had that flag), so, I am at a loss to explain what I am seeing.

Question is simply: What should I make of this and what should I do about it?

Upvotes: 0

Views: 503

Answers (0)

Related Questions