[libprotobuf FATAL external/protobuf_archive/src/google/protobuf/stubs/common.cc:79] This program was compiled against version 2.6.1 of the Protocal Buffer runtime library, which is not compatible with the installed version(3.6.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 Protocal Buffers as your link-time library. (Version verification failed in "/build/mir-08_xaj/mir-0.26.3+16.044.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 Protocal Buffer runtime library, which is not compatible with the installed version (3.6.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 the Protocal Buffers as your link-time library. (Version verification failed in "/build/mir-08_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gun/src/protobuf/mir_protobuf.pb.cc".)
在使用C++编译的Tensorflow和Opencv4.0.0的时候,出现以上错误,属于protobuf的版本冲突问题。
主要问题就是,编译安装的Tensorflow中的protobuf是3.6的,其中的libprotobuf.so.17,在Opencv中使用的是protobuf2.6.1
的/usr/lib/x86_64-linux-gnu/ 中出现的是libprotobuf.so.9。
在编译安转Opencv的时候,使用的GTK3,而GTK3依赖于protobuf2.6.1,而GTK2不会这样。
所以在编译opencv的时候,将GTK选项去掉,使用GTK_2_X。
重新编译安装,解决问题。