gtk编译时运行时不需要
1. 在头文件中含有#include <gtk/gtk.h>,但在通过gcc编译时会有”gtk/gtk.h,没有那个文件或目录”的提示,原
你试试在终端用pkg-config命令查查看需要用-I参数指定哪些目录才能用gtk。
pkg-config --cflags gtk+-2.0
我执行这个命令后输出的是
-pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
把你执行这个命令后输出的那一段复制后添加在你gcc的命令行再编译试试看。
2. 我再ubuntu下安装OpenCV是编译的时候没有提示错误,但是在运行程序的时候提示:
简单的解释就是你的GTK+2.x要先于OpenCV安装,所以它给的解决方法是You should remove the current installation of opencv from your system; rebuild your opencv lib after installing gtk dev lib in the correct path; and reinstall the compiled opencv lib.
3. Ubuntu下opencv编译没有报错,但是运行不了
简单的解释就是你的GTK+2.x要先于OpenCV安装,所以它给的解决方法是You should
remove the current installation of opencv from your system; rebuild your
opencv lib after installing gtk dev lib in the correct path; and
reinstall the compiled opencv lib.