2017-04-05 31 views
1

衝突的I具有與從源代碼和的Protobuf庫的contrib模塊安裝OpenCV的一些問題。的OpenCV 3.2包括libmir *和protobuf的2.6,其與protobuf的3.1

我有一個計劃,需要的Protobuf 3.1。和帶有contrib模塊的OpenCV 3.2。編譯和安裝源代碼後,程序本身編譯和鏈接良好。當執行程序時,我得到以下錯誤:

[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.1.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-pkdHET/mir-0.21.0+16.04.20160330/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.1.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-pkdHET/mir-0.21.0+16.04.20160330/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)

檢查我的軟件鏈接庫,我看到的protobuf被列入2.6。 (so.9)和3.1(so.11)以及libmir *。所以

ldd localization | grep protobuf* 
libprotobuf.so.11 => /usr/local/lib/libprotobuf.so.11 (0x00007f1797df8000) 
libmirprotobuf.so.3 => /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3 (0x00007f178a751000) 
libprotobuf-lite.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9 (0x00007f178a31b000) 

展望鏈接庫,我發現opencv的鏈接

  • libmir文庫(其使用protobuf的)與
  • 的Protobuf 2.6(libprotobuf-lite.so.9 /在usr/lib中/ x86_64的Linux的GNU的)

,而我的Protobuf 3.1是在/ usr /本地/ 同樣的OpenCV採用libprotobuf 3.1。建立DNN零件等

~$ ldd /usr/local/bin/opencv* | grep libproto* 
libprotobuf-lite.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9 

ldd /usr/local/bin/opencv* | grep libmir* 
libmirclient.so.9 => /usr/lib/x86_64-linux-gnu/libmirclient.so.9 (0x00007f1d59b4c000) 
libmircommon.so.5 => /usr/lib/x86_64-linux-gnu/libmircommon.so.5 (0x00007f1d56d5f000) 
libmirprotobuf.so.3 => /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3 (0x00007f1d56afe000) 
  • 當什麼是什麼是它用於/由libmir *(libmirclient9或libmirclient-dev的或libmircommon5等都是通過apt安裝顯然)和?
  • opencv的哪3的一部分/庫/模塊使用libprotobuf 2.6和libmir?
  • 如何配置不使用任何的protobuf庫opencv的3的版本(或鏈接到它)
  • 任何其他方式來編譯自己的程序,而不protobuf的2.6或libmirprotobuf

非常感謝你爲你的努力。

BR弗洛裏安

回答

1

好,建設WITH_QT = ON消除了需要libmir因此libprotobuf 2.6

這裏是全cmake的命令,即工作:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..