c++ - 使用 conan 和 cmake 编译会出现致命错误 LNK1104
问题描述
试图在我的代码中编译和使用 3rd 方库。它实际上之前工作过,然后我尝试移动一个目录,即使在恢复到 . 我找到了一些相关的答案,但它已经对我有用,所以我认为它不应该是什么大问题。我正在使用 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'
解决方案
推荐阅读
- javascript - 与数据库的连接适用于 next.config.js 环境变量,但使用 .env 文件失败
- python-asyncio - Aiofiles 导入在 buildozer、apk 构建中不起作用但崩溃
- xamarin.android - 如何最好地设置 Xamarin Android 项目以支持不同型号的硬件
- reactjs - 太多的重新渲染。React 限制渲染次数以防止无限循环
- python - 当我在 django 中使用 get_absolute_url 时仍然在同一页面
- ruby-on-rails - Rails 暂存迁移环境
- google-analytics - 是否可以使用 @nuxtjs/google-analytics 实现 Google 增强型电子商务?
- javascript - useEffect 可以使用两个或多个函数吗?
- c# - 如何将 ASP.NET Core 5 MVC 项目连接到 Supabase 数据库而不是 SQL Server?
- c# - 从 Byte[] 到 unixTimestamp 以毫秒为单位