我有一些CMake和Boost庫的麻煩。我有以下錯誤:CMake與Boost無法找到靜態庫
CMake Error at C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/FindBoost.cmake:1111 (message): Unable to find the requested Boost libraries.
Boost version: 1.55.0
Boost include path: C:/local/boost_1_55_0
Could not find the following static Boost libraries:
boost_system
boost_date_time
boost_regex
No Boost libraries were found. You may need to 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:10 (find_package)
-- Configuring incomplete, errors occurred!
我做了我在我的CMakeLists.txt中找到的所有東西,但它不工作,我不明白。 我使用Windows 8與Visual Studio 12和Boost安裝在默認目錄中。 (C:/本地/ boost_1_55_0)
這裏我的CMakeLists.txt:
cmake_minimum_required(VERSION 2.6)
project (server)
set(BOOST_ROOT "c:\\local\\boost_1_55_0")
set (Boost_USE_STATIC_LIBS ON) set (Boost_MULTITHREADED ON) set
(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.55 COMPONENTS system date_time regex REQUIRED)
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
set(SRCS main.cpp Server.cpp Client.cpp)
set(HEADERS Server.h Client.h)
include_directories(${Boost_INCLUDE_DIR})
add_executable(babel_server ${SRCS} ${HEADERS})
target_link_libraries(babel_server ${Boost_LIBRARIES})
任何人都可以幫我嗎?
謝謝
可以打印出Boost_LIBRARYDIR和Boost_INCLUDE_DIR使用消息的值(解決了您的CMake腳本? – elSnape
如果您打算在CMakeLists.txt中放置路徑,我會使用/而不是\ – drescherjm
向我們顯示您用於安裝boost的命令。對我來說,我通常使用「./b2 install」 – DinoStray