[CMake] Linking with -l and -L flags
William A. Hoffman
billlist at nycap.rr.com
Fri Jan 13 19:29:01 EST 2006
At 05:12 PM 1/13/2006, Brad King wrote:
>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
>___________
This may be the flag we are looking for:
-search_paths_first
By default when the -dynamic flag is in effect, the -lx and
-weak-lx options first search for a file of the form
`libx.dylib' in each directory in the library search path, then
a file of the form `libx.a' is searched for in the library
search paths. This option changes it so that in each path
`libx.dylib' is searched for then `libx.a' before the next path
in the library search path is searched.
So, -Wl,-search_paths_first.
-Bill
More information about the CMake
mailing list