
XX的杰子
已结题
采纳率85.7%
2023-11-03
protobuf编译错误
使用protobuf出现的问题
1、Ubuntu版本:18.04.6
2、protobuf的安装步骤
protobuf版本:3.11.0
3、又安装了protobuf的兼容 sudo apt install build-essential autoconf libtool
4、生成的cpp文件报错
PROTOBUF_NAMESPACE_OPEN namespace internal //报错
//添加代码
#define PROTOBUF_NAMESPACE_OPEN \
namespace google \
{ \
namespace protobuf \
#define PROTOBUF_NAMESPACE_CLOSE \
} \
#define PROTOBUF_NAMESPACE_ID google::protobuf
#define PROTOBUF_CONSTEXPR
#define PROTOBUF_ATTRIBUTE_REINITIALIZES
#define PROTOBUF_NODISCARD [[nodiscard]]
#define PROTOBUF_ALWAYS_INLINE
using namespace google;
//又报错
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- 写回答
- 好问题
- 分享
- 邀请回答
- 更多