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

Thomas Deschamps tdeschamps at lbl.gov
Tue Oct 22 16:49:42 EDT 2002


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
>  
>





More information about the CMake mailing list