使用 protobuf 编译的 qtcreator 问题

qtcreator issue compiling with protobuff

我正在尝试使用新版本的 protobuf 编译我的代码(目前它是使用自定义版本编译的,我想通过 apt-get 使用 ubuntu 附带的版本编译它)

在我添加的项目设置中 -lprotobuf

.obj/Test.pb.o: In function `test_ns::protobuf_AssignDesc_Test_2eproto()':
<<path to file>>/Test.pb.cc:115: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::string const&) const'

错误行([=​​22=]):

void protobuf_AssignDesc_Test_2eproto() {
  protobuf_AddDesc_Test_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "Test.proto");

我可以看到试图定位文件 "Test.proto" 时导致的错误,但它存在于另一个目录中,并且被 protoc 命令用来生成 Test.pb.cc 和 [=24] =] 文件

只是资助原因,ubuntu提供的protobuff使用不同的ABI编译,匹配我们项目中的ABI修复了问题