OpenCV 3.2 includes libmirprotobuf and protobuf 2.6 which is conflicting with protobuf 3.1

asked 2017-04-05 11:12:38 -0500

der_flori gravatar image

updated 2017-04-05 11:18:32 -0500

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

edit retag flag offensive close merge delete

Comments

I'm having a similar issue with Qt and protobuf. If I find the answer, I will post it here.

mannyglover gravatar imagemannyglover ( 2017-05-09 15:04:59 -0500 )edit

I also received the same error after following along with this tutorial: http://www.pyimagesearch.com/2016/10/...

On Ubuntu 16.04

technoconserve gravatar imagetechnoconserve ( 2017-09-22 13:46:12 -0500 )edit

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...

pvilas gravatar imagepvilas ( 2017-09-27 11:35:45 -0500 )edit

I encountered the same problem! How to fix it ?

sharonHappy gravatar imagesharonHappy ( 2017-11-10 01:10:50 -0500 )edit

Same problem! Help!

mescarra gravatar imagemescarra ( 2018-04-03 08:18:37 -0500 )edit