使用 gtk 2.0 的 gcc 错误消息
gcc error message with gtk 2.0
我的main.c:
#include <stdlib.h>
#include <gtk/gtk.h>
int main(int argc, char **argv)
{
return EXIT_SUCCESS;
}
我使用:
gcc `pkg-config --cflags --libs libgtk+-2.0` -o tresor main.c
但我收到此错误:
Package libgtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libgtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libgtk+-2.0' found
main.c:2:21: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
^
compilation terminated.
make: *** [tresor] Error 1
我检查了 libgtk2.0-dev 和 libgtk2.0-0,它已经安装了。
我尝试更新、升级删除并再次安装。没用。
只需要将包名调整为gtk+-2.0 :
gcc `pkg-config --cflags --libs gtk+-2.0` -o tresor main.c
我的main.c:
#include <stdlib.h>
#include <gtk/gtk.h>
int main(int argc, char **argv)
{
return EXIT_SUCCESS;
}
我使用:
gcc `pkg-config --cflags --libs libgtk+-2.0` -o tresor main.c
但我收到此错误:
Package libgtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libgtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libgtk+-2.0' found
main.c:2:21: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
^
compilation terminated.
make: *** [tresor] Error 1
我检查了 libgtk2.0-dev 和 libgtk2.0-0,它已经安装了。 我尝试更新、升级删除并再次安装。没用。
只需要将包名调整为gtk+-2.0 :
gcc `pkg-config --cflags --libs gtk+-2.0` -o tresor main.c