我正在尝试编译需要提升的mlpack(http://www.mlpack.org/)。 首先我安装了boostpro 1.51(http://www.boostpro.com/download/)并且现在在C:\ Program Files \ boost \ boost_1_51中安装了boost
然后我使用cmake和mingw32-make编译并安装了armadillo(mlpack的另一个依赖)。 Boost也是犰狳的依赖。遵循一些建议(Cmake doesn't find Boost),我添加到CMakeLists文件:
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:\\Program Files\\boost\\boost_1_51")
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:\\Program Files\\boost\\boost_1_51\\lib")
事情进展顺利。
现在我尝试在mlpack上运行CMake但是出现了这个错误:
C:/ Program Files(x86)/ CMake 2.8 / share / cmake-2.8 / Modules / FindBoos的CMake错误 t.cmake:1192(消息): 无法找到请求的Boost库。
Boost版本:1.51.0
Boost包含路径:C:/ Program Files / boost / boost_1_51
找不到以下Boost库:
boost_program_options boost_unit_test_framework
找不到Boost库。您可能需要将BOOST_LIBRARYDIR设置为 目录包含Boost库或BOOST_ROOT到的位置 促进。 呼叫堆栈(最近一次呼叫): CMakeLists.txt:192(find_package)
我试图添加(至于犰狳),但没有改进:
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:\\Program Files\\boost\\boost_1_51")
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:\\Program Files\\boost\\boost_1_51\\lib")
然后我也尝试添加:
set(BOOST_ROOT "C:\\Program Files\\boost\\boost_1_51")
set(BOOST_INCLUDEDIR "C:\\Program Files\\boost\\boost_1_51")
set(BOOST_LIBRARYDIR "C:\\Program Files\\boost\\boost_1_51\\lib")
对于BOOST_INCLUDEDIR,我真的不知道我应该指出哪个文件夹。 boost_1_51包含:bin,boost,dist,doc,lib,libs,more
我也试过这个(cmake is using the wrong cboost libs),但没有成功。
我也有点困惑,因为犰狳似乎没有问题编译(或者我错过了什么?)
非常感谢
注意:cmakelists文件的内容:
#Unfortunately this configuration variable is necessary and will need to be
#updated as time goes on and new versions are released.
set(Boost_ADDITIONAL_VERSIONS "1.41" "1.41.0" "1.42" "1.42.0" "1.43" "1.43.0" "1.44" "1.44.0" "1.45.0" "1.46.0" "1.46.1" "1.47.0" "1.48.0" "1.49.0" "1.51.0")
find_package(Boost
COMPONENTS
program_options
unit_test_framework
REQUIRED
)
include_directories(${Boost_INCLUDE_DIRS})
我自己添加了1.51.0。
从我对另一篇文章(CMake not finding Boost)的理解,这可能与找不到具有正确名称的库有关。在我的lib文件夹中,我有(dll和lib文件):
boost_program_options-vc80-mt-1_51.dll
boost_program_options-vc80-mt-gd-1_51.dll
boost_program_options-vc100-mt-1_51.dll
boost_program_options-vc100-mt-gd-1_51.dll
不知怎的,我应该玩像
这样的命令set(Boost_USE_MULTITHREADED ON)
这样它就会找到具有预期名称的lib ????