[CMake] Linking problem

Salvatore Iovene salvatore.iovene+cmake at googlemail.com
Wed Nov 7 06:40:16 EST 2007


On 11/7/07, Hendrik Sattler <post at hendrik-sattler.de> wrote:
> 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.


Thanks f or your answer. I checked ld man page and I think you refer
to the --export-dynamic option. Building my libs with -fPIC seemed to
fix the problem on Linux, so do I really need that ld option?

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8


More information about the CMake mailing list