[protobuf][C++]protobuf编译报错无法解析的外部符号 google::protobuf::internal::ExplicitlyConstructed fixed_address

问题描述:

编译好的protobuf3.20.0在项目中引用后运行报错:

无法解析的外部符号 google::protobuf::internal::ExplicitlyConstructed fixed_address

解决方法:

从网上查要在引用的头文件里增加 #define PROTOBUF_USE_DLLS,但是编译时会报protobuf.lib的重定义错误,于是把PROTOBUF_USE_DLLS定义放到工程的预处理器定义里就好了。

你可能感兴趣的:(环境配置,开发语言)