View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002087CMakeCMakepublic2005-07-29 19:462005-08-17 11:46
ReporterChris Scharver 
Assigned ToBill Hoffman 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionduplicate 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002087: Lib prefix stripped from Win32 linking
DescriptionUsing the CMake 2.2 beta, I am unable to properly link an external library. The library is named 'libcave_ogl_mt_MDd'. I have a FindAVELib.cmake file that locates the library without any trouble. It's properly registered in my CMakeCache.txt:

CMakeCache.txt:CAVE_cave_LIBRARY:FILEPATH=C:/VRCO/CAVELib_3.1.1/lib32/libcave_ogl_mt_MDd.lib

Unfortunately, something gets mangled in the linking process. I am targeting nmake with Visual Studio 7 .NET 2003. Here's what shows up in the generated build rule:

GoThere.dir/build.make: /W3 /Zm1000 /GX /GR /MDd /Zi /Od /GZ $(GoThere_OBJECTS) $(GoThere_EXTERNAL_OBJECTS) /FeGoThere.exe -link /STACK:10000000 /machine:I386 /INCREMENTAL:YES /debug /subsystem:console -LIBPATH:C:\Coin3D\lib -LIBPATH:C:\VRCO\CAVELib_3.1.1\lib32 -LIBPATH:C:\user\chris\Profile\Desktop\CyberGloveCode\build\oivcaveapp wsock32.lib cave_ogl_mt_MDd.lib coin2.lib glu32.lib opengl32.lib oivcaveapp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Note that the library's prefix has been removed! It appears that the generator is making assumptions and removing prefixes even when they are needed. The above example links without any trouble with CMake 2.0.6, but I hope to take advantage of newer features like ADD_SUBDIRECTORY.
TagsNo tags attached.
Attached Fileszip file icon hello.zip [^] (2,001 bytes) 1969-12-31 19:00

 Relationships

  Notes
(0002910)
Chris Scharver (reporter)
2005-08-17 11:36

I created a sample demonstrating the problem. I created a library libhello.lib. The CMakeLists.txt file locates this library. Configuring using the 2.2 beta and NMakefiles, the link stage fails because CMake strips the library prefix. As a result, the resulting nmakefile tries to link with 'hello.lib'.

Interestingly, when I build libhello.lib using CMake, this problem does not occur. However, that's simply not an option for third-party libraries. I wonder if this might be some kind of bug in results from FIND_LIBRARY?
(0002911)
Bill Hoffman (manager)
2005-08-17 11:46

This bug has been reported and fixed in cvs, and will be fixed in 2.2.1, for now use cvs cmake.

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team