[CMake] Linking problem

Hendrik Sattler post at hendrik-sattler.de
Wed Nov 7 06:33:31 EST 2007


Quoting Salvatore Iovene <salvatore.iovene+cmake at googlemail.com>:
> On 11/7/07, Salvatore Iovene <salvatore.iovene+cmake at googlemail.com> wrote:
>
>> What do you mean by PIC?
>> Thanks!
>
> Oh, -fPIC. I figured it out. Seems to work fine on Linux. I still have
> to try it on Windows tho. I hope it's good as a solution and not just
> a hack! :)

Windows DLLs work differently.

When putting code into shared object under Linux, they _must_ be  
compiled as PIC. Back to your problem: GNU ld has an option to  
forcibly include all symbols during linking instead of only the used  
ones, take a look at its manpage.

HS




More information about the CMake mailing list