PROTOBUF_INLINE_NOT_IN_HEADERS [英] PROTOBUF_INLINE_NOT_IN_HEADERS
问题描述
我正在尝试在debian 8上安装开源项目Open Transactions.我已经安装了所有依赖项,并且在编译(make)时遇到问题.即使我确保安装了protobuf项目,终端上仍显示以下错误:
I'm trying to install Open Transactions, the open-source project, on a debian 8. I've installed all the dependencies and am having an issue when compiling (make). The following error is showing at my terminal, even though i made sure to install the protobuf project:
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
有关如何处理此问题的任何想法?在线找不到任何帮助.
Any ideas on how to deal with this? Couldn't find any help online.
推荐答案
我在Ubuntu 14.04上遇到了同样的问题,并且按照您所说的进行了修复.但是我只是在写这篇文章来解释这个问题.
因此,在搜索了错误之后,我发现了讨论.他们在其中描述问题是由于Google编码人员依赖C ++标准允许您将未定义的预处理器符号视为值为0的事实而引起的.因此,有一堆#if指令可测试的值PROTOBUF_INLINE_NOT_IN_HEADERS
尚未在任何地方定义时;这是合法的,应将其视为零.
我通过在顶级SConstruct的CCFLAGS和src/SConscript(CXXFLAGS)的CXXFLAGS中添加-DPROTOBUF_INLINE_NOT_IN_HEADERS=0
来解决此问题,
I had the same problem on Ubuntu 14.04 and I fix it as you said . But I am just writing to explain more the issue.
So , After googling the error I found this discussion . In which they describe that the problem arises from the fact that the google coders are relying on the fact that the C++ standard allows you to treat an undefined preprocessor symbol as evaluating to 0. So there is a bunch of #if directives testing the value of PROTOBUF_INLINE_NOT_IN_HEADERS
when it hasn’t been defined anywhere; this is legal and should be treated as if it’s a zero.
I fixed this by adding -DPROTOBUF_INLINE_NOT_IN_HEADERS=0
into CCFLAGS in the the top-level SConstruct and CXXFLAGS in src/SConscript (CXXFLAGS) and that seemed to catch it.
因此,要解决此问题,您应该在opentxs主文件夹中找到的CMakeList.txt中添加以下行:
So to fix this , you should add this line in the CMakeList.txt that you find in opentxs main folder :
add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS = 0)
add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS=0)
别忘了重复cmake
步骤.
希望这更加清楚和有用.
Hope this is more clear and helpful .
这篇关于PROTOBUF_INLINE_NOT_IN_HEADERS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!