如何使用gtk 2.x而不是gtk3.x编译opencv

时间:2017-11-27 02:58:28

标签: c++ linux qt opencv gtk

我使用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?

0 个答案:

没有答案