2017-04-05 5 views
1

ソースコードと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 * .soの

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/localにあるときにもOpenCVのはlibprotobufを使用しています3.1。など

~$ 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) 
  • DNN部品を構築するとき、それは/によってのために使用されるものlibmirの*(libmirclient9またはlibmirclient-devのかlibmircommon5など明らかになりやすい経由でインストールされている)とは何ですか?
  • Opencv 3のどの部分/ライブラリ/モジュールでlibprotobuf 2.6とlibmirを使用していますか?私はどんないるProtobufライブラリを使用していないのOpenCV 3のビルドを設定することができますどのように(またはそれにリンクしている)
  • いるProtobuf 2.6または

libmirprotobufせずに自分のプログラムをコンパイルするために、他の方法ありがとうございましたあなたの努力のために。

BRフロリアン

答えて

1

[OK]を、 ON = WITH_QTを構築する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 .. 
関連する問題