C++ linked statically?

Dimitry Andric dimitry@andric.com
Tue May 26 18:44:00 GMT 2009


On 2009-05-26 20:20, Piotr Borys wrote:
>> -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
> 
> Well... it seems it built it dynamically:
> $ ./parking: can't load library 'libstdc++.so.6'

If possible, please post the full command line used to link the program.
You can retrieve this by adding "-v" to your LDFLAGS.


> I saw somewhere some suggestion with this -W option, too (although
> with other params) - where can I find some help on its use?

http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Link-Options.html#index-Wl-878

  -Wl,option
      Pass option as an option to the linker. If option contains commas,
      it is split into multiple options at the commas.

E.g. you pass the option "-Bstatic" to ld.  This GNU ld option is
described here:

http://sourceware.org/binutils/docs/ld/Options.html#index-g_t_002dBdynamic-135

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list