No package 'gtk+-2.0' found (PKG_CONFIG_PATH问题) [复制链接] 0 0

用gcc 编译
#include
int main()
{
return 0;
}
gcc callbacks.c `pkg-config --libs --cflags gtk-2.0` -o callbacks
出现错误

Package gtk-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk-2.0' found
callbacks.c:1:21: fatal error: gtk/gtk.h: 没有那个文件或目录
compilation terminated.

但我在 /usr/lib 下找到了 一个名为 gtk-2.0的文件夹,应该是有gtk库的呀。查看了网上的方法
修改了/etc/ld.so.conf 添加了 /usr/lib 和 /usr/local/lib 然后执行 ldconfig,问题依然存在!!


解决了,直接 apt-get install libgtk2.0-dev

你的机器没有安装gtk的开发库

你可能感兴趣的:(未分类)