help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

shared object skips exporting some functions varaibles to give unresolve


From: Nilesh
Subject: shared object skips exporting some functions varaibles to give unresolved symbols while using it in exe
Date: 13 Sep 2006 10:12:51 -0700
User-agent: G2/1.0

Hi g++ and AIX users,

I am facing problem in using a so inan EXE . I created the so.
Versions: g++ 4.4.1 on AIX 5.2 system.

The way .so is built:
.so is statically linking with stdc++, gcc, gcc_eh .
g++ -D_DEBUG -g -shared -o libiif.so -O3 -v  ../src/BMCIIF_Mutex.d
../src/BMCIIF_AutoMutex.d  ../src/CXMLReader.d
../src/BMCIIF_Statistics.d  ../src/BMCIIF_Logger.d
../src/BMCIIF_Utilities.d  -L/usr/lib/threads -L../lib_aix -L../lib
-L/usr/local/lib -L/usr/lib  -Wl,-bstatic  -lstdc++ -lgcc -lgcc_eh
-Wl,-bdynamic -lpthread -liiapi  -lnsl  -lm -lc -ltli

So builds successfully.

The EXE is using it like this:
g++ -o EXENAME -O3 -v  -L/usr/lib/threads  -L/usr/local/lib -L/usr/lib
-L./../../libs/aix -lstdc++ -lgcc -lgcc_eh -liiapi -lm -lnsl -lpthread
-lc -Wl,-blibpath:/home/ngujarat/work/BiiF/libs/aix -Wl,-brtl -liif
../src/THIRDPARTYEMSReceiver.o  ../src/BiiMain.o

PROBLEM:
But EXE compilation fails with "ld: 0711-317 ERROR: Undefined symbol:"
Errors for some constructors. Destructors, static data members in  a
class. Perhaps these are not referenced directly in course code.

NOTE: I ran "nm" on libiif.so  for Undefined symbols and they are not
found in the SO.


Article details below are not addressing this issue:
http://www-128.ibm.com/developerworks/eserver/articles/gnu.html

WHY Is this happening? Anything wrong in building SO or wrong use of
SO? Flags missing?
-Wl,-G with -Wl,-brtl was given , exe builds delaying the resolution at
run time, but when EXE is  run , it crashes.

Thanks
Nilesh



reply via email to

[Prev in Thread] Current Thread [Next in Thread]