gpt4 book ai didi

c++ - 具有 boost 1.56 的卡萨布兰卡因 -Werror 而失败

转载 作者:太空狗 更新时间:2023-10-29 23:00:41 27 4
gpt4 key购买 nike

我正在尝试构建 Casablanca使用 boost 1.56,但由于 Casablanca 的 -Werror 将 boost 警告转为错误,我的构建一直失败旗帜

例如:

CXX=g++ BOOST_ROOT=${boost} cmake .. -DCMAKE_BUILD_TYPE=Release

产生错误(太多无法显示)

/home/matt/workspace/opal2/o2linux64/Libs/boost/1.56/include/boost/system/error_code.hpp:222:36: error: ‘boost::system::errno_ecat’ defined but not used [-Werror=unused-variable]
static const error_category & errno_ecat = generic_category();
^
/home/matt/workspace/opal2/o2linux64/Libs/boost/1.56/include/boost/system/error_code.hpp:223:36: error: ‘boost::system::native_ecat’ defined but not used [-Werror=unused-variable]
static const error_category & native_ecat = system_category();
^
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/cpprest.dir/http/client/http_client_msg.cpp.o] Error 1

我似乎无法在谷歌上找到任何补救措施,尽管我发现人们使用 1.56 构建的帖子并且没有提到禁用 Werrorsrc/CMakeList.txt (偶然地似乎允许代码构建)

最佳答案

要防止编辑 Casablanca 的 CMakeLists.txt,可以在运行 cmake 命令时添加 -DWERROR=OFF 参数,例如:

cmake -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF <path to src>

请注意,cmake 可以缓存选项值,因此最好在干净的构建目录中重新运行 cmake

关于c++ - 具有 boost 1.56 的卡萨布兰卡因 -Werror 而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33133725/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com