Qt错误:运行代码后,在qt中获取protobuf错误

时间:2018-02-21 05:58:43

标签: c++ qt

[libprotobuf FATAL ../SaarathyClient/external/google/protobuf/stubs/common.cc:78] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.3.0).  Contact the program author for an update.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "/build/mir-O8_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.3.0).  Contact the program author for an update.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "/build/mir-O8_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)
The program has unexpectedly finished.

我在运行代码时遇到错误。为了解决这个问题,我已经执行了一些步骤 -

(SYSTEM REQUIERMENTS == os- Ubuntu 16.04 LTS,Qt creator-Application development-opensource-latest V4.5rc)

  1. 我的系统中缺少已安装的协议缓冲区V3.5.1。
  2. 使用新的更新更新了Qt。
  3. 运行代码后,我仍然遇到同样的错误。

1 个答案:

答案 0 :(得分:3)

打开project.pro并替换如下

LIB += -lprotobuf

LIBS += /usr/local/lib/libprotobuf.a