[CMake] NMake Makefiles, 2.4.4 and target link libraries

Patrick J. Franz -- ML patrick at xia.com
Tue Nov 28 18:44:29 EST 2006


I upgraded to v2.4.4 today from v2.4.4-p3, I believe, and noticed that 
one of my projects was no longer building. The error from the build 
looks like:

> Linking C shared library lib\my_library.dll
> LINK : fatal error LNK1104: cannot open file "lib/my_library_dep.dll.lib"
> NMAKE : fatal error U1077: 'link' : return code '0x450'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\N
> MAKE.EXE"' : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\N
> MAKE.EXE"' : return code '0x2'
> Stop.

This is built from a Makefile generated with the "NMake Makefiles" 
generator. The obvious problem is that there is no 
'my_library_dep.dll.lib' file available since the link library is named 
'my_library_dep.lib'. (I verified that 'my_library_dep.lib' was built 
and is present in the lib/ subdirectory.)

The relevant part of my CMakeLists.txt is:

ADD_LIBRARY(my_library SHARED ${my_library_sources})
TARGET_LINK_LIBRARIES(my_library my_library_dep)

Has anyone else experienced this problem?

Best Regards,
Patrick



More information about the CMake mailing list