我正在开发一个 c++ 程序,该程序使用 cmake 和 conan 进行编译,并 boost 1.7.4。最近,我开始收到:错误:#error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3.
该程序直到最近都运行良好,现在才开始出现此错误。
这是我的cmake代码
#find external libraries with Conan
----------------------------------------------------------
conan_check(VERSION 1.0.0 REQUIRED)
message(STATUS "Downloading dependency libraries with Conan")
#The boost dependency is tricky.
#Need 1.74 for correct behavior, and need options to successfully build on mac
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
#workaround for https://github.com/conan-io/conan-center-index/issues/4097
set(CONAN_OPTIONS boost:without_fiber=True boost:without_nowide=True)
else()
set(CONAN_OPTIONS )
endif()
conan_cmake_run(REQUIRES boost/1.74.0 jsoncpp/[>=1.8.4] eigen/[>=3.3.7] cgal/[>=5.1]
OPTIONS
${CONAN_OPTIONS}
BUILD missing
CMAKE_TARGETS
BASIC_SETUP
UPDATE)
我相信 boost 1.7.4 只支持文件系统 v3,有没有办法检查我的 Boost 文件系统版本?任何可能的修复将不胜感激。
最佳答案
我们遇到了同样的问题。我通过添加(本地)修复了它
'boost:filesystem_version = 3'
到我们的 conanfile.py 的默认选项{}
。看起来最近对食谱的更改是罪魁祸首:https://github.com/conan-io/conan-center-index/pull/11988
关于c++ - Cmake 中的 Boost 文件系统版本错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73392648/