gpt4 book ai didi

protocol-buffers - PROTOBUF_INLINE_NOT_IN_HEADERS

转载 作者:行者123 更新时间:2023-12-04 04:21:42 25 4
gpt4 key购买 nike

我正在尝试在 debian 8 上安装开源项目 Open Transactions。我已经安装了所有依赖项,但在编译 (make) 时遇到问题。即使我确保安装了 protobuf 项目,我的终端仍显示以下错误:

In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:64:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Generics.pb.h:501:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:65:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Markets.pb.h:2062:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:66:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Bitcoin.pb.h:833:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:67:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Moneychanger.pb.h:1026:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
cc1plus: all warnings being treated as errors
src/core/CMakeFiles/opentxs-core.dir/build.make:1368: recipe for target 'src/core/CMakeFiles/opentxs-core.dir/OTStorage.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/opentxs-core.dir/OTStorage.cpp.o] Error 1
make[2]: Leaving directory '/root/opentxs/build'
CMakeFiles/Makefile2:586: recipe for target 'src/core/CMakeFiles/opentxs-core.dir/all' failed
make[1]: *** [src/core/CMakeFiles/opentxs-core.dir/all] Error 2
make[1]: Leaving directory '/root/opentxs/build'
Makefile:150: recipe for target 'all' failed
make: *** [all] Error 2

关于如何处理这个问题有什么想法吗?无法在线找到任何帮助。

最佳答案

我在 Ubuntu 14.04 上遇到了同样的问题,我按照你说的修复了它。但我只是写信来解释更多的问题。
所以,在谷歌搜索错误后我发现了这个 discussion .他们在其中描述了问题源于这样一个事实,即谷歌编码器依赖于 C++ 标准允许您将未定义的预处理器符号视为评估为 0 的事实。因此有一堆 #if 指令测试的值PROTOBUF_INLINE_NOT_IN_HEADERS 当它没有在任何地方被定义时;这是合法的,应该被视为零。
我通过将 -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 添加到顶层 SConstruct 中的 CCFLAGS 和 src/SConscript (CXXFLAGS) 中的 CXXFLAGS 中来解决此问题,这似乎捕获了它。

因此,要解决这个问题,您应该在 opentxs 主文件夹中找到的 CMakeList.txt 中添加这一行:

add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS=0)

不要忘记重复 cmake 步骤。

希望这更清晰、更有帮助。

关于protocol-buffers - PROTOBUF_INLINE_NOT_IN_HEADERS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34474091/

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