kicad-developers team mailing list archive
Mailing list archive
Re: Re: libstdc++
Dick Hollenbeck <dick@...>
Thu, 25 Mar 2010 09:38:46 -0500
Thunderbird 126.96.36.199 (X11/20100317)
Dick Hollenbeck a écrit :
Good point. But I was thinking that Jean Pierre was statically linking
in the wxWidgets libraries to the apps. If not, I don't see how he has
gotten as far as he has with these "universal x86 linux binaries".
Of course, wxWidgets is linked statically (and it is also patched)
Preinstalled wxWidgets versions (when exist) never work.
I tried to link statically libsupc++ (under Ubuntu 9.10 and GCC 4.4),
and I was lucky! it worked:
1 - Locate libsupc++.a and add it to libs list
2 - use gcc instead of g++ to call the linker.
Note: I used my old makefiles to test that, because it was more easier
to quickly test different link options.
I now must test binaries under different Linux distribs.
For the historical record, even though you Jean-Pierre may not need this:
for Ubuntu 9.10 x86_64, these statically linkable libraries, libstd++
and libsupc++, are in package libstd++6-4.4-dev
For 32 bit systems, replace the /x86_64-linux-gnu with i486-linux-gnu.
However, I wonder if you even need to know the path?
I thought I found an interesting posting here and linker command line
g++ -static-libgcc ... -Wl,-bstatic -lstdc++ -Wl,-bdynamic -lsupc++
HOWEVER, I don't think the original poster got the lsupc++ correctly as
static. Should it not be:
g++ -static-libgcc ... -Wl,-Bstatic -lstdc++ -lsupc++ -Wl,-Bdynamic
Jean-Pierre, you really do not need your make files. All you need to do
is capture the last line of each CMake command, by running it as
$ make VERBOSE=1
to see how g++ is being invoked to perform the link for each program
binary. Then you can cut and paste that command into a shell script
(along with any preceding directory change), and edit the script to do
what is described above with respect to the two libraries.
This is not my can of worms, so I am going to back away now.
There are two solutions on the table, and either seems good and clear.