Remy 源码(github) protobuf 编译错误class
Remy source code(github) compilation error in protobuf class
我正在尝试 运行 Remy 项目(与计算机生成的网络协议相关)使用此 link 中提供的说明的源代码; https://github.com/tcpexmachina/remy。代码也取自这个link。
我使用的是 protobuf 3.5.1 版本,Ubuntu 版本是 14.04。当我 运行 在 运行ning ./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++”标志吗?
如果有人以前遇到过此错误或对此类问题有任何经验,请帮助我解决此错误。
谢谢
Flag -Weffc++
当您的代码违反 Scott Meyers 在其著作(Effective C++ 系列)中定义的任何样式指南时启用警告。
这些准则之一告诉 base class 应该已经定义了虚拟析构函数 - 你得到了关于它的编译器消息。其他指南是
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
makes all warnings into errors
并且您的编译已中止。我认为您应该从编译器标志列表中删除 Weffc++
或 -Werror
以编译您的代码。
我正在尝试 运行 Remy 项目(与计算机生成的网络协议相关)使用此 link 中提供的说明的源代码; https://github.com/tcpexmachina/remy。代码也取自这个link。
我使用的是 protobuf 3.5.1 版本,Ubuntu 版本是 14.04。当我 运行 在 运行ning ./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++”标志吗? 如果有人以前遇到过此错误或对此类问题有任何经验,请帮助我解决此错误。 谢谢
Flag -Weffc++
当您的代码违反 Scott Meyers 在其著作(Effective C++ 系列)中定义的任何样式指南时启用警告。
这些准则之一告诉 base class 应该已经定义了虚拟析构函数 - 你得到了关于它的编译器消息。其他指南是
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
makes all warnings into errors
并且您的编译已中止。我认为您应该从编译器标志列表中删除 Weffc++
或 -Werror
以编译您的代码。