0
fatal error: gtk/gtk.h: No such file or directory
 #include <gtk/gtk.h>
          ^~~~~~~~~~~
compilation terminated.

I kept getting this error even though I am sure GTK4.0 is installed through MSYS2mingw64. In case you are wondering my launch.json and task.json all have the neccessary file path included. I just don't get it why is it not running?

I saw this fix: gcc -o test test.c 'pkg-config --cflags gtk+-4.0' 'pkg-config --libs gtk+-4.0'

But got this error instead: gcc.exe: error: pkg-config --cflags gtk+-4.0: No such file or directory gcc.exe: error: pkg-config --libs gtk+-4.0: No such file or directory

Can someone advise pls?

unique27
  • 1
  • 3
  • 1
    That "fix" you found (which is actually not a fix but the normal way to do it) is valid for using gcc on Linux shell. There you must use backticks `\`` instead of apostrophs `'`. That will execute the content and replace it by the output. I am not sure if that works for MinGW/MSYS tools in a similar way. If you build via VSCode you must configure everything in the json files. – Gerhardh Oct 26 '22 at 09:53

0 Answers0