[Cmake] Specifying static or dynamic linking of external libraries?

William A. Hoffman bill.hoffman at kitware.com
Tue Oct 22 17:59:11 EDT 2002


What version of cmake are you using?

-Bill

At 01:49 PM 10/22/2002 -0700, Thomas Deschamps wrote:
>Dear Bill,
>
>I am using cmake. This order has been given by cmake. I did not try to 
>change it. The 'ldl' should be included by cmake, since it is set in its 
>macro CMAKE_DL_LIBS, but it is not, as I wrote in my previous post.
>My problem is that cmake makes this call that I've included and that it 
>doesn't want to include neither CMAKE_DL_LIBS nor CMAKE_X_LINK which are 
>set properly in my environment.
>This is what I am trying to understand. I would like to be sure that 
>someone did succeed to link against static libraries, and that the error 
>is coming from me and not from cmake.
>Thank you for your help.
>
>Thomas (tdeschamps at lbl.gov)
>
>Bill Hoffman wrote:
>
>>So, I can see two problems:
>>
>>1. This is the wrong order:
>>-lvtkCommon -lvtkRendering -lvtkHybrid -lvtkImaging -lvtkGraphics 
>>-lvtkFiltering -lvtkIO Any symbols in vtkCommon that are needed by 
>>vtkRendering will be skipped.
>>
>>2. The vtkDynamicLoader class needs -ldl to link because it calls dlopen 
>>and dlclose.
>>
>>So, if you changed the order and added -ldl it should work.
>>Both of these are not really cmake issues.  However, if you used cmake to 
>>compile
>>test, then it would get the library order correct.
>>
>>-Bill
>>
>
>
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake






More information about the CMake mailing list