Hello all Xubuntu users!
I installed GTK+3.0 via APT. But trying to compile a simple example GTK program failed claiming about missing gtk.h:
gcc `pkg-config --cflags gtk+-3.0` -o app app.c `pkg-config --libs gtk+-3.0` Package gtk+-3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-3.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-3.0' found Package gtk+-3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-3.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-3.0' found app.c:1:10: fatal error: gtk/gtk.h: Datei oder Verzeichnis nicht gefunden #include <gtk/gtk.h> ^~~~~~~~~~~ compilation terminated. makefile:2: recipe for target 'app' failed make: *** [app] Error 1
"pkg-config --cflags gtk+-3.0" prints:
Package gtk+-3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-3.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-3.0' found
But "locate gtk.h" prints:
/home/peter/linux-5.3.8/tools/perf/ui/gtk/gtk.h /usr/include/clutter-gtk-1.0/clutter-gtk/clutter-gtk.h /usr/include/gtk-2.0/gtk/gtk.h /usr/include/gtk-3.0/gtk/gtk.h /usr/share/doc/libgtk-3-doc/gtk3/gtk.html /usr/share/gtk-doc/html/libcanberra/libcanberra-canberra-gtk.html
"locate gtk+3.0.pc" prints nothing!
I also tried to reinstall GTK+ and to update the general distribution via APT. But the error didn't go away.
What can I do now? I don't want to add an include commandline-option to the C compiler every time. Instead I want to use pkg-config like the GTK documentation recommends.
I use Xubuntu 18.04 LTS.
Greetings Peter
Moderiert von Taomon:
Dieses Thema ist verschoben worden. Bitte beachte die als wichtig markierten Themen („Welche Themen gehören hier her und welche nicht?“)!