1. 程式人生 > >Ubuntu中libprotobuf版本沖突的解決方案

Ubuntu中libprotobuf版本沖突的解決方案

ram 不知道 .com pda -o 原因 runt des proto

先說解決方法:

因為我出現這個比較奇特,我再下面環境中的第一個項目有這個問題,但是不知道怎麽瞎折騰就搞定了,不報這個異常了

不論是Qt Creator直接運行Debug或者Release都沒問題

但是我後續建立的項目始終有這個問題,經過幾天的折騰發現新項目如果使用sudo命令啟動程序就不會報異常,所以目前我的Qt Creator也用sudo命令啟動。

下面的方法我都沒有嘗試過,但是應該最貼近根本原因的。

至於為什麽同一個Qt Creator創建並打開的第一個項目正常,但是後續的就異常,目前還不清楚,後續調查清楚了再來更新。

先介紹一下環境:

Ubuntu 16.04

Qt 5.10

Caffe封裝的人臉檢測庫

錯誤原因:

Caffe中用到的libprotobuf版本與Qt中引用的版本沖突

具體異常如下:

技術分享圖片

Debugging starts

[libprotobuf FATAL 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".)

程序異常堆棧如下:

技術分享圖片

技術分享圖片

網絡上找到的靠譜資源:

c++ - Protobuf version conflicts with Qt - Stack Overflow

技術分享圖片

Qt for Linux/X11 - Building from Source | Qt 5.11

ParaView built with Qt 5.X linux release fails with protobuf error (#17751) · Issues · ParaView / ParaView · GitLab

.

Ubuntu中libprotobuf版本沖突的解決方案