OpenCV 3.2 includes libmirprotobuf and protobuf 2.6 which is conflicting with protobuf 3.1
Hello,
I have some issues with installing OpenCV with contrib modules from sources codes and Protobuf libraries.
I have a program, that needs Protobuf 3.1. and OpenCV 3.2 with contrib modules. After compiling and installing both from sources, the program itself compiles and linked well. When executing the program, I get the following error:
[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".)
Checking the linked libraries of my software, I see that protobuf was included in 2.6. (so.9) and 3.1 (so.11) as well as 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)
Looking into the linked libraries, I found out that the included Opencv linked
- libmir* libraries (which are using protobuf) with
- Protobuf 2.6 (libprotobuf-lite.so.9 in usr/lib/x86_64-linux-gnu/)
while my Protobuf 3.1 is in /usr/local/ Also opencv uses libprotobuf 3.1. when building DNN parts etc.
~$ 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)
- What is libmir* (libmirclient9 or libmirclient-dev or libmircommon5 etc. are installed via apt apparently) and what is it used for / by?
- Which part / library / module of Opencv 3 uses libprotobuf 2.6 and libmir? * How can I configure a build of Opencv 3 not using any libmir* or protobuf 2.6 library (or which links to it)
- any other way to exclude protobuf 2.6 from my program
Thank you very much for your effort.
BR Florian
I'm having a similar issue with Qt and protobuf. If I find the answer, I will post it here.
I also received the same error after following along with this tutorial: http://www.pyimagesearch.com/2016/10/...
On Ubuntu 16.04
I think it can be related with gtk, try whith: -D WITH_GTK=OFF -D WITH_GTK_2_X=OFF -D \ -D WITH_QT=ON \
you have a look at: http://pvilas.com/2017/09/Install-ope...
I encountered the same problem! How to fix it ?
Same problem! Help!