terminal – GTK installation on Mac doesn’t seem to be working

SubhamSeptember 3, 2022
Spread the love


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 all I get is an error.

Categories

Leave a comment

Name *
Add a display name
Email *
Your email address will not be published
Website