RE: to build an so containing libgcc.so and libstdc++.so

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

 



Hi Venkatakrishnan,

>Any guesses why???

Link order is my guess.

Try to make sure that things are stacked in the order of dependency, with the least dependent last.

Assuming that myLib1 depends on things in myLib2, and they depend on things in stdc++, m and c:
g++ -Wl,-nostdlib -L/user/local/lib -Wl,-dy -lmyLib1 -Wl,-dn -lmyLib2 -Wl,-dy -lstdc++ -Wl,-dn -lm -lc -o myApp

The -Wl,-nostdlib is for when you are explicitly listing out the standard libraries.

The -Wl,-dy is to link against dynamic libraries (.so, .dylib, .library, .shlib, .dll ... depending on OS).

The -Wl,-dn is to link against static libraries.

If you run across an undefined symbol, look at the file where you expected it to be and see if it is there.  You can use the 'nm' or 'objdump' commands to display tons of good information about object and library files.

HTH,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux