尝试在代码中编译和使用第三方库。它实际上工作之前,然后我试图移动一个目录,它停止工作,即使恢复到。我找到了一些相关的答案,但它已经为我工作,所以我认为它不应该是什么大的。我正在使用Visual Studio 2019编译。相关的CMakeList.txt代码:
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(REQUIRES boost/1.70.0-7
protobuf/3.11.2-1
BASIC_SETUP)
target_link_libraries(main ${CONAN_LIBS})
错误是:
fatal error LNK1104: cannot open file 'libboost_atomic-vc141-mt-sgd-x64-1_70.lib'
1条答案
按热度按时间11dmarpk1#
您需要通过将
add_definitions(-DBOOST_ALL_NO_LIB)
添加到您的cmake项目中来禁用MSVC的自动链接,如下所述