我使用tensorflow 1.4& qt在ubuntu 16.04中。问题是当我同时包含tensorflow(版本:1.4)和opencv(版本:3.2.0)时,protobuf会发生冲突。错误消息如下:
[libprotobuf FATAL external/protobuf_archive/src/google/protobuf/stubs/common.cc:79] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.4.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-O8_xaj/mir-0.26.3+16.04.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 Protocol Buffer runtime library, which is not compatible with the installed version (3.4.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-O8_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)
我从某个地方了解到,使用gtk-3.x
的opencv将使用导致上述问题的protobuf 2.6.1
,并且使用gtk-2.x
安装opencv将不依赖于protobuf。 opencv cmake msg的一部分如下,cmake自动使用gtk 3.x
。
GUI:
-- QT: NO
-- GTK+ 3.x: YES (ver 3.18.9)
-- GThread : YES (ver 2.48.2)
-- GtkGlExt: NO
-- OpenGL support: NO
-- VTK support: NO
系统gtk信息如下:
$ pkg-config --modversion gtk+-2.0
$ 2.24.30
以下是问题。如何使用gtk 2.x
使用cmake
安装opencv?