我已经安装了升级版。我正在尝试编译一个在cmake行中具有以下行的项目:
target_link_libraries(
tiscos_stat
${Boost_TIMER_LIBRARY}
这在编译时会导致问题:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_TIMER_LIBRARY (ADVANCED)
我使用sudo apt-get install libboost-all-dev
我的usr / include / boost文件夹中有一个timer.hpp
为什么会这样?我是否需要安装更多库?
请帮忙。
编辑:
以下是运行带有-DBoost_DEBUG=ON
标志
`r@r-HP-Mini-110:~/l33t/freeln/raijin_world/source/raijin/build-debug$ cmake ../ -DBoost_DEBUG=ON
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:525 ] Boost not in cache
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:528 ] _boost_TEST_VERSIONS = 1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:530 ] Boost_USE_MULTITHREADED = ON
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:532 ] Boost_USE_STATIC_LIBS =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:534 ] Boost_USE_STATIC_RUNTIME =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:536 ] Boost_ADDITIONAL_VERSIONS =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:538 ] Boost_NO_SYSTEM_PATHS =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:606 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:608 ] BOOST_ROOT =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:610 ] BOOST_INCLUDEDIR =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:612 ] BOOST_LIBRARYDIR =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:614 ] _boost_TEST_VERSIONS = 1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:696 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:715 ] version.hpp reveals boost 1.46.1
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:808 ] guessed _boost_COMPILER = -gcc47
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:818 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:861 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:863 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:906 ] _boost_LIBRARY_SEARCH_DIRS = /usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;C:/boost/lib;C:/boost;/boost/boost_1_46_1/lib;/boost/boost_1_46/lib;/boost/lib;/boost;/sw/local/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for DATE_TIME_LIBRARY_RELEASE: boost_date_time-gcc47-mt-1_46_1;boost_date_time-gcc47-mt;boost_date_time-mt-1_46_1;boost_date_time-mt;boost_date_time
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for DATE_TIME_LIBRARY_DEBUG: boost_date_time-gcc47-mt-d-1_46_1;boost_date_time-gcc47-mt-d;boost_date_time-mt-d-1_46_1;boost_date_time-mt-d;boost_date_time-mt;boost_date_time
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-gcc47-mt-1_46_1;boost_filesystem-gcc47-mt;boost_filesystem-mt-1_46_1;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-gcc47-mt-d-1_46_1;boost_filesystem-gcc47-mt-d;boost_filesystem-mt-d-1_46_1;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: boost_program_options-gcc47-mt-1_46_1;boost_program_options-gcc47-mt;boost_program_options-mt-1_46_1;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: boost_program_options-gcc47-mt-d-1_46_1;boost_program_options-gcc47-mt-d;boost_program_options-mt-d-1_46_1;boost_program_options-mt-d;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for SERIALIZATION_LIBRARY_RELEASE: boost_serialization-gcc47-mt-1_46_1;boost_serialization-gcc47-mt;boost_serialization-mt-1_46_1;boost_serialization-mt;boost_serialization
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for SERIALIZATION_LIBRARY_DEBUG: boost_serialization-gcc47-mt-d-1_46_1;boost_serialization-gcc47-mt-d;boost_serialization-mt-d-1_46_1;boost_serialization-mt-d;boost_serialization-mt;boost_serialization
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-gcc47-mt-1_46_1;boost_system-gcc47-mt;boost_system-mt-1_46_1;boost_system-mt;boost_system
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-gcc47-mt-d-1_46_1;boost_system-gcc47-mt-d;boost_system-mt-d-1_46_1;boost_system-mt-d;boost_system-mt;boost_system
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for TIMER_LIBRARY_RELEASE: boost_timer-gcc47-mt-1_46_1;boost_timer-gcc47-mt;boost_timer-mt-1_46_1;boost_timer-mt;boost_timer
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for TIMER_LIBRARY_DEBUG: boost_timer-gcc47-mt-d-1_46_1;boost_timer-gcc47-mt-d;boost_timer-mt-d-1_46_1;boost_timer-mt-d;boost_timer-mt;boost_timer
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-gcc47-mt-1_46_1;boost_thread-gcc47-mt;boost_thread-mt-1_46_1;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-gcc47-mt-d-1_46_1;boost_thread-gcc47-mt-d;boost_thread-mt-d-1_46_1;boost_thread-mt-d;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE: boost_unit_test_framework-gcc47-mt-1_46_1;boost_unit_test_framework-gcc47-mt;boost_unit_test_framework-mt-1_46_1;boost_unit_test_framework-mt;boost_unit_test_framework
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for UNIT_TEST_FRAMEWORK_LIBRARY_DEBUG: boost_unit_test_framework-gcc47-mt-d-1_46_1;boost_unit_test_framework-gcc47-mt-d;boost_unit_test_framework-mt-d-1_46_1;boost_unit_test_framework-mt-d;boost_unit_test_framework-mt;boost_unit_test_framework
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1119 ] Boost_FOUND = FALSE
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1202 (message):
Unable to find the requested Boost libraries.
Boost version: 1.46.1
Boost include path: /usr/include
The following Boost libraries could not be found:
boost_timer
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
CMakeLists.txt:30 (find_package)
-- Configure C++ compiler options for GNU
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_TIMER_LIBRARY (ADVANCED)
`
答案 0 :(得分:2)
从调试输出看,CMake正在查找Boost版本1.46.1。 Boost.Timer库已在1.48.0升级,您需要升级版本。
要安装当前版本的boost,请参阅文档的Getting Started on Unix Variants页面。