Hi Friends,
I am creating a shared library using gcc for interfacing with SAP. This library uses functions from 3 static libraries. Out of these 3 static libraries one is provided by SAP and contains all the APIs required for communication with any third party software.
I am linking these static libraries with the shared one by following command.
gcc -o "shared lib" "obj of lib created using -fPIC" -l"staticlib1" -l"staticlib2" -l"staticlib3"
I can't mention the lib names.
I am able to create the library, but it contains unresolved symbols for the functions defined in the static libraries. One thing to note is all these symbols are either global or inline functions. But all of them have valid definitions in the corresponding static libraries. (globals in SAP provided lib, and others in our libs)
I think the linking sequence for gcc is from right to left. But when I try to link the SAP provided library after the other two, ld terminates with segmentation fault. Changing the order of other 2 libs doesn't give problems. The only SAP library gives trouble.
I am not able to find any solution to this problem. Can anybody help me?
It will be nice if I could get more info about linker sequence, creation of symbol tables, etc.
regards,
-Kshitij.
kshitijv
e-mail: kshitijv(a)forindia.com