Re: is there any way to change the order of name resolution in linking (aside from putting the libraries in the right order?)

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

 



On 27 September 2012 15:05, Feuerbacher, Alan wrote:
> Ian Lance Taylor wrote:
>
>
>> One thing that may work, if you are using the GNU linker or something
>> reasonably compatible, is
>>     -Wl,--whole-archive,-lMYLIB,-Wl,--no-whole-archive
>>
>> That will link in the entire contents of the library, so all the
>> symbols defined in the library will be available.
>
> I'm trying something like that for a related purpose, but for it to work you have to replace the "," after "MYLIB" with a space. Otherwise gcc complains about an invalid option "-Wl".

I expect the linker complains about that option, not GCC.

This should also work:

-Wl,--whole-archive,-lMYLIB,--no-whole-archive


[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