[CMake] Linking with -l and -L flags

Brad King brad.king at kitware.com
Fri Jan 13 17:12:40 EST 2006


kmorel wrote:
> On 1/12/06 5:37 PM, "William A. Hoffman" <billlist at nycap.rr.com> wrote:
>>You can I think do -static ..... -dynamic ....
> Nope.  I get the following error.
> ld: only one of -dynamic or -static can be specified

On most UNIX-like platforms one can do this:

   ... -Wl,-Bstatic -ltcl -Wl,-Bdynamic ...

and only static tcl libraries will be considered by the linker.  The 
"-Wl," part tells the compiler to pass the following flag to the linker. 
  The "-Bstatic" and "-Bdynamic" switch the favored library type in the 
linker.

It looks like those flags don't work with the Mac's linker.  You'll have 
to find the equivalent flags.  I suggest asking around in some Mac 
develoeper community.

-Brad


More information about the CMake mailing list