Re: [CMake] Unable to locate boost_unit_test_framework-vc90-mt-gd-1_45.lib
On 08/12/2011 03:48 PM, Stephen Torri wrote: Using Mathias and Fraser's guidance I made the changes to the CMakeLists.txt file for the test directory. -DBOOST_ALL_NO_LIB is how I would have fixed it, but I guess that should work. That removed the error that but now I have 9 unresolved external symbols even though the boost unit test framework library is listed in the Linker options for the test executable. Is this more of a problem with how I built Boost than a CMake issue? You didn't link test with mycode. The Boost lib directory only has .lib files in it. I guess those are static libraries. As I already told you, .lib is both for static and import libraries (what you have to link against to use a DLL). This is not CMake-specific, this is a windows thing. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Unable to locate boost_unit_test_framework-vc90-mt-gd-1_45.lib
On 08/10/2011 04:27 PM, Stephen Torri wrote: 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. The difference between the version with the lib and the one without is that one is a static library and the other is an import library for a DLL. That kind of error probably comes from the fact that Boost does auto-linking with MSVC and that the library you've selected with CMake does not match what the header expects. In any case, the documentation of FindBoost covers this. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Unable to locate boost_unit_test_framework-vc90-mt-gd-1_45.lib
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 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake