当我在{strong> VS 2019(win10)中使用cmake
时,没有项目属性菜单可以设置其他依赖项。我认为我应该使用cmake
文件中的cmakelists.txt
命令来执行此操作。我可以使用Armadillo
进行构建,但是如果.cpp
包含det(A)
命令构建会导致链接器错误。我想我无法链接到blas和lapack libs。
我包含了Armadillo\armadillo-9.800.1\include
目录。
我还包括了Armadillo\armadillo-9.800.1\examples\lib_win64
目录,但是如果我理解正确的话,这还不够。我需要知道cmake
中 VS 的其他依赖项设置的相应命令。
我收到错误消息:LNK2019 unresolved external symbol dgetrf referenced in function void __cdecl arma::lapack::getrf<double>(int *,int *,double *,int *,int *,int *)
cmakelists.txt的内容是:
project(CMakeProject9)
cmake_minimum_required (VERSION 3.8)
# Add source to this project's executable.
add_executable (CMakeProject9 "CMakeProject9.cpp" "CMakeProject9.h")
# TODO: Add tests and install targets if needed.
target_include_directories(CMakeProject9 PRIVATE "C:/Projects/Armadillo/armadillo-9.800.1/include" "C:/Projects/Armadillo/armadillo-9.800.1/examples/lib_win64")
target_link_libraries(CMakeProject9 PRIVATE "C:/Projects/Armadillo/armadillo-9.800.1/examples/lib_win64")
即使我从cmakelists.txt文件中删除了链接命令(在下面添加),我也会遇到相同的错误。他们是无效的。否则我无法正确使用它们。
project(CMakeProject9)
cmake_minimum_required (VERSION 3.8)
# Add source to this project's executable.
add_executable (CMakeProject9 "CMakeProject9.cpp" "CMakeProject9.h")
# TODO: Add tests and install targets if needed.
target_include_directories(CMakeProject9 PRIVATE "C:/Projects/Armadillo/armadillo-9.800.1/include")