报错内容:
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.9/gcc_64/plugins/platformthemes的库libqgtk3.so引起的。 如果您的项目中不需要它,您可以重命名/删除它以使错误消失。
另外,如果要用cmake+qt的方式构建项目,则还需要删除QT中相应的cmake模块文件:Qt5Gui_QGtk3ThemePlugin.cmake。
个人体会,cmake 对 QT的支持在3.9以后的版本才变得方便。
在Ubuntu16.04上安装QT5.9时遇到Protocol Buffer版本不兼容错误,报错提示程序编译针对的是2.6.1版本,而运行时库为3.6.1版本。解决方法包括以管理员身份启动QT编译器或重命名/删除引起冲突的库文件,以及对于使用cmake+qt构建的项目,可能需要删除QT中的cmake模块文件Qt5Gui_QGtk3ThemePlugin.cmake。
3万+

被折叠的 条评论
为什么被折叠?



