且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PROTOBUF_INLINE_NOT_IN_HEADERS

更新时间:2023-02-17 13:51:48

我在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 .