The following is the beginner’s file from the raspberrypi.org site. The C language file is saved as gtktest.c.
The problem I am experiencing is that the compiler does not recognize the gtk library. The error message that results from attempts to compile is “gtk/gtk.h not recognized”. This even though said file appears in the pkg-config file. I have searched extensively online and not found a solution. The underlying machine is a raspy 4.0 from Canakit. Any help would be greatly appreciated.
The file, the command line, and the pkg-config file appear below.
Another concern is that in Geany, Project/Properties is grayed out preventing attempts to compile under that medium. Furthermore, attempts to use the “L” and “l” directives in the command line result in the error message ’no such file” even when the said files are in the same directory as the source .c file.
int main(int argc, char *argv)
gtk_init (&argc, &argv);
GtkWidgit *win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
pkg-config —cflags —libsgtk+=2.0 gtktest.c -o gtktest
pi@raspberrypi:~ $ pkg-config --cflags --libs gtk±2.0
-pthread -I/usr/include/gtk-2.0 -I/usr/lib/arm-linux-gnueabihf/gtk-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype