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


先說解決方法:

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

不論是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  

 

.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM