[CMake] Unable to locate boost_unit_test_framework-vc90-mt-gd-1_45.lib

Stephen Torri stephen.torri at gmail.com
Thu Aug 11 10:30:17 EDT 2011


On Wed, Aug 10, 2011 at 9:51 PM, Michael Hertling <mhertling at online.de>wrote:

>  On 08/10/2011 04:27 PM, Stephen Torri wrote:
> > I am having a problem setting up CMake to find the Boost unit test
> framework
> > library when building a test program. In the top level CMakeLists.txt
> file I
> > have:
> >
> > ENABLE_TESTING()
> >
> > add_subdirectory ( path/to/test )
> >
> > In the test directory CMakeLists.txt file I have:
> >
> > LINK_DIRECTORIES ( ${Boost_LIBRARY_DIRS} )
> > ADD_EXECUTABLE ( test test.cpp )
> > ADD_TEST ( test ${CMAKE_CURRENT_BINARY_DIR}/test )
> >
> > I added the LINK_DIRECTORIES because I though that the linker was not
> > getting the path to the Boost library. That is wrong since the full path
> to
> > the library is in the properties for this project. So I figured since it
> had
> > the full name it should be able to find it. Not quite.
> >
> > The error message I get says:
> >
> > LNK1104: cannot open file 'boost_unit_test_framework-vc90-mt-gd-1_45.lib'
> >
> > I have boost installed in C:\boost. The FIND_BOOST macro able to find the
> > installation headers and libraries I require. The only thing that is
> > different is that the directory has the Boost unit test framework named
> as:
> >
> > C:\boost\lib\libboost_unit_test_framework-vc90-mt-gd-1_45.lib
> >
> > That name, libboost_unit_test...., is different from the expected name of
> > boost_unit_test...
> >
> > I am at a loss as to why this is the case.
> >
> > CMake version: 2.8.4
> > Boost version: 1.45
> >
> > Stephen
>
> Could you provide a minimal but complete example that demonstrates
> the issue, perhaps along with the output from the build phase?
>
> Regards,
>
> Michael
>
Attached is a minimal example that shows the problem. Below is the output
from the build log:

--------------------
build.log
--------------------


Creating temporary file "c:\Documents and Settings\Stephen.Torri\My
Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\test.dir\Debug\RSP00001A37404960.rsp"
with contents

[

/Od /I "C:\boost" /I "C:\Documents and Settings\Stephen.Torri\My
Documents\Visual Studio 2008\Projects\problem_boost_test" /D "WIN32" /D
"_WINDOWS" /D "_DEBUG" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD /EHsc
/RTC1 /MDd /Fo"test.dir\Debug\\" /Fd"C:\Documents and
Settings\Stephen.Torri\My Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\Debug/test.pdb" /W3
/c /Zi /TP   /Zm1000



"..\..\..\mycode\Testing\test.cpp"

]

Creating command line "cl.exe @"c:\Documents and Settings\Stephen.Torri\My
Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\test.dir\Debug\RSP00001A37404960.rsp"
/nologo /errorReport:prompt"

Creating temporary file "c:\Documents and Settings\Stephen.Torri\My
Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\test.dir\Debug\RSP00001C37404960.rsp"
with contents

[

/OUT:"C:\Documents and Settings\Stephen.Torri\My Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\Debug\test.exe"
/VERSION:0.0 /INCREMENTAL /MANIFEST
/MANIFESTFILE:"test.dir\Debug\test.exe.intermediate.manifest"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Documents
and Settings\Stephen.Torri\My Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\Debug/test.pdb"
/SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Documents and
Settings\Stephen.Torri\My Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\Debug\test.lib"
 /STACK:10000000
/machine:X86 /debug kernel32.lib user32.lib gdi32.lib winspool.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib



".\test.dir\Debug\test.obj"



".\test.dir\Debug\test.exe.embed.manifest.res"

]

Creating command line "link.exe @"c:\Documents and Settings\Stephen.Torri\My
Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\test.dir\Debug\RSP00001C37404960.rsp"
/NOLOGO /ERRORREPORT:PROMPT"



--------------------

Build output

--------------------



1>------ Skipped Build: Project: RUN_TESTS, Configuration: Debug Win32
------

1>Project not selected to build for this solution configuration

2>------ Build started: Project: mycode, Configuration: Debug Win32 ------

3>------ Build started: Project: test, Configuration: Debug Win32 ------

2>Compiling...

3>Compiling...

2>mycode.cpp

3>test.cpp

2>Creating library...

2>Build log was saved at "file://c:\Documents and Settings\Stephen.Torri\My
Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\mycode.dir\Debug\BuildLog.htm<file:///c:/Documents%20and%20Settings/Stephen.Torri/My%20Documents/Visual%20Studio%202008/Projects/problem_boost_test/vs2008/mycode/mycode.dir/Debug/BuildLog.htm>
"

2>mycode - 0 error(s), 0 warning(s)

3>Linking...

3>LINK : fatal error LNK1104: cannot open file
'boost_unit_test_framework-vc90-mt-gd-1_45.lib'

3>Build log was saved at "file://c:\Documents and Settings\Stephen.Torri\My
Documents\Visual Studio
2008\Projects\problem_boost_test\vs2008\mycode\Testing\test.dir\Debug\BuildLog.htm<file:///c:/Documents%20and%20Settings/Stephen.Torri/My%20Documents/Visual%20Studio%202008/Projects/problem_boost_test/vs2008/mycode/Testing/test.dir/Debug/BuildLog.htm>
"

3>test - 1 error(s), 0 warning(s)

4>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32
------

4>Project not selected to build for this solution configuration

========== Build: 1 succeeded, 1 failed, 1 up-to-date, 2 skipped ==========
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110811/46b9ea69/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: problem_boost_test.zip
Type: application/zip
Size: 2622 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110811/46b9ea69/attachment.zip>


More information about the CMake mailing list