QT5.12与Protocol Buffer不兼容

QT5.12与Protocol Buffer不兼容问题

报错内容

This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.6.1).  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.6.1).  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".)

解决办法

  • 方法一
    QT 默认调用16.04自带的2.6.1的protocol bufffer,所以以管理员的身份启动QT编译器,才能选择你配置的路径
  • 方法二
    /opt/Qt/5.12/gcc_64/plugins/platformthemes的库libqgtk3.so引起的。 如果您的项目中不需要它,您可以重命名/删除它以使错误消失。
    另外,如果要用cmake+qt的方式构建项目,则还需要删除QT中相应的cmake模块文件:Qt5Gui_QGtk3ThemePlugin.cmake。
    个人体会,cmake 对 QT的支持在3.9以后的版本才变得方便。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值