| Author |
Static Linking of stdc++ in .so file
|
|
|
| I am trying to statically link the stdc++ library in my .so. It gives me
core dump when .so load in executable. While dynamically link stdc++ will
work perfectly fine. My gcc version is 3.3.2.
Can anyone suggest how to link stdc++ libs statically in my .so file ?
Thanks
J
| |
| Thobias Vakayil 2005-11-23, 3:57 am |
| jay wrote:
>I am trying to statically link the stdc++ library in my .so. It gives me
>core dump when .so load in executable. While dynamically link stdc++ will
>work perfectly fine. My gcc version is 3.3.2.
>
>Can anyone suggest how to link stdc++ libs statically in my .so file ?
>
>
>
>Thanks
>
>J
>
>
>
>
While linking the application, use -Bstatic option.
Regards,
Thobias Vakayil
| |
| Nilesh 2005-11-23, 7:57 am |
| I use it like this. Staica linking works fine for me but my so also has
STL functions because of which EXE using so crashes.
g++ -o libMy.so.1.0 -D_DEBUG -g -O3 -static-libgcc -nostdlib ../src/M.d
../src/A.d ../src/C.d -L/usr/lib -L/usr/local/lib -L/usr/ccs/bin
-L/usr/ccs/lib -G -Wl,-Bstatic -lstdc++ -lgcc_eh -lgcc -Wl,-Bdynamic
-lpthread -lposix4 -lc
Hope this helps.
-Nilesh
|
|
|
|