remy source code(github) 编译错误在 protobuf 类

Remy source code(github) compilation error in protobuf class

本文关键字:错误 protobuf 编译 source code github remy      更新时间:2023-10-16

我试图使用此链接中提供的入侵运行 Remy 项目(与计算机生成的网络协议相关(源代码; https://github.com/tcpexmachina/remy。代码也取自此链接。

我正在使用protobuf 3.5.1版本,Ubuntu版本是14.04。当我按照自述文件中的说明分别运行 ./autogen.sh 和 ./configure 后运行"make"命令时,我收到此错误:

In file included from configrange.hh:4:0,
from evaluator.cc:3:
../protobufs/dna.pb.h:4210:20: error: base class ‘struct         
google::protobuf::internal::integral_constant<bool, true>’ has a    
non-virtual destructor [-Werror=effc++]
template <> struct is_proto_enum< ::RemyBuffers::MemoryRange_Axis> : 
::google::protobuf::internal::true_type {};

我查看了存储库的问题部分,但它没有列出任何此类错误。该项目是否有可能使用了导致此错误的旧版本的protobuf?还有人可以解释什么是"-Werror=effc++"标志吗?如果有人以前遇到过此错误或遇到过此类问题,请帮助我解决此错误。谢谢

标志-Weffc++ 当您的代码违反 Scott Meyers 在他的书(有效C++系列(中定义的任何样式准则时启用警告。
其中一个准则告诉基类应该定义了虚拟析构函数 - 并且您得到了有关它的编译器消息。其他准则包括

 Define a copy constructor and an assignment operator for classes with dynamically-allocated memory.
 Prefer initialization to assignment in constructors.
 Have operator= return a reference to *this.
 Don’t try to return a reference when you must return an object.
 Distinguish between prefix and postfix forms of increment and decrement operators.
 Never overload &&, ||, or ,.

通过启用-Weffc++您只会收到警告,但我看到-Werror也在编译器标志列表中定义。 -Werror

将所有警告变为错误

并且您的编译已中止。我认为您应该从编译器标志列表中删除Weffc++-Werror来编译您的代码。