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

先說解決方法:html

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

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

可是我後續創建的項目始終有這個問題,通過幾天的折騰發現新項目若是使用sudo命令啓動程序就不會報異常,因此目前個人Qt Creator也用sudo命令啓動。git

下面的方法我都沒有嘗試過,可是應該最貼近根本緣由的。網絡

至於爲何同一個Qt Creator建立並打開的第一個項目正常,可是後續的就異常,目前還不清楚,後續調查清楚了再來更新。gitlab

 

先介紹一下環境:ui

Ubuntu 16.04google

Qt 5.10spa

Caffe封裝的人臉檢測庫3d

錯誤緣由:

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  

 

.

相關文章
相關標籤/搜索