I have been trying to get started on GTK for Mac. I followed the installation steps and ran the hello-world program. I keep getting this error with gcc, though. Running
gcc $(pkg-config --cflags gtk4) -o hello-world-gtk hello-world-gtk.c $(pkg-config --libs gtk4)
returns the following errors:
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk4' found
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk4' found
hello-world-gtk.c:1:10: fatal error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
^~~~~~~~~~~
1 error generated.
I found a similar problem here, but the user says they already have gcc/g++ working. I don't.
Any ideas? I ran the installation script included in the installation steps and nothing changes.
Also, I have tried replacing the line
#include <gtk/gtk.h>
with
#include <gtk-2.0/gtk/gtk.h>
I then get this error:
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk4' found
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk4' found
In file included from hello-world-gtk.c:1:
/usr/local/include/gtk-2.0/gtk/gtk.h:32:10: fatal error: 'gdk/gdk.h' file not
found
#include <gdk/gdk.h>
^~~~~~~~~~~
1 error generated.
If I add the flags -I/usr/include/gtk-2.0 -lgtk2.0
to my compile statement, I get the same error.