我正在尝试在Windows 8上安装MLPack.我使用以下命令配置CMakeLists.txt文件:
set(ARMADILLO_LIBRARY "C:\\Program Files (x86)\\armadillo\\lib")
set(ARMADILLO_INCLUDE_DIR "C:\\Program Files (x86)\\armadillo\\include")
Run Code Online (Sandbox Code Playgroud)
然后,当我运行CMake时,我发出了一系列警告,如下所示:
WARNING: Target "mlpack" requests linking to directory "C:\Program Files (x86)\armadillo\lib". Targets may link only to libraries. CMake is dropping the item.
Run Code Online (Sandbox Code Playgroud)
在\ mlpack-1.0.4\src\mlpack目录中,我找到了另一个CMakeLists文件:
target_link_libraries(mlpack
${ARMADILLO_LIBRARIES}
${Boost_LIBRARIES}
${LIBXML2_LIBRARIES}
)
Run Code Online (Sandbox Code Playgroud)
我改为(不确定这是不是一个好主意):
target_link_libraries(mlpack
${Boost_LIBRARIES}
)
link_directories(mlpack
${ARMADILLO_LIBRARIES}
${LIBXML2_LIBRARIES}
)
Run Code Online (Sandbox Code Playgroud)
然后CMake似乎运行顺利:
-- Found Armadillo: C:\Program Files (x86)\armadillo\lib (found suitable version "3.800.2", minimum required is "2.4.2")
-- Found LibXml2: C:\cpp\libraries\libxml2-2.7.8.win32\lib (found suitable version "2.7.8", minimum required is "2.6.0")
-- Boost version: 1.53.0
-- Found …Run Code Online (Sandbox Code Playgroud)