[CMake] CMake 2.4.2 Cygwin shouldn't have -ldl

Brad King brad.king at kitware.com
Thu Jun 1 14:25:38 EDT 2006


Brandon J. Van Every wrote:
> Brad King wrote:
> 
>> Brandon J. Van Every wrote:
>>
>>> I have investigated, and I'm not convinced that the -ldl is coming 
>>> from my code.  My code is:
>>>
>>> CHECK_INCLUDE_FILE(dl.h HAVE_DL_H)
>>> IF(HAVE_DL_H)
>>>   ADD_DEFINITIONS(-DHAVE_DL_H)
>>>   SET(EXTRA_LIBS ${EXTRA_LIBS} ldl)
>>> ENDIF(HAVE_DL_H)
>>>
>>> There is no dl.h on any hard drive of my system.  Which is to be 
>>> expected, as it's a Linux thing.  I think the -ldl more likely from 
>>> building CMake 2.4.2 on Cygwin incorrectly.  I will await your 
>>> canonical version and see if the problem goes away.
>>
>>
>> What does HAVE_DL_H say in your cache?  
> 
> 
> //Have include dl.h
> HAVE_DL_H:INTERNAL=
> 
>> If you remove the entry manually from the file does it come back with 
>> "yes"?
>>
> 
> When I run ccmake again, it comes back with exactly the same thing.
> 
> To be very sure of the conclusion, I comment out the entire 
> CHECK_INCLUDE_FILE sequence.
> Now there is no way for my code to be inserting a -ldl.  It still shows up.
> 
> Linking C shared library libchicken.dll
> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: 
> cannot find
> -ldl
> collect2: ld returned 1 exit status
> make[2]: *** [libchicken.dll] Error 1
> make[1]: *** [CMakeFiles/libchicken.dir/all] Error 2
> make: *** [all] Error 2
> 
> 
> I'm inclined to believe that the CMake 2.4.2 build on Cygwin has an 
> error in it somewhere.

Go to your build tree for CMake and run "bin/ctest" to make sure all the 
tests pass.  They definately build some shared libraries.

-Brad


More information about the CMake mailing list