Hello, i was trying to compile a C file that includes:
#include <gtk/gtk.h>
following this tutorial, but vs code gave me the error:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/teratron/Dev/c/games/tutorials/brickout/main.c).
cannot open source file "gtk/gtk.h"
plus it keeps adding gtk-3.0 before the include making it:
#include <gtk3.0/gtk/gtk.h>
trying to compile the file using gcc also doesn't work:
/Dev/c/games/tutorials/brickout$ gcc main.c Brickout
main.c:1:10: fatal error: gtk/gtk.h: No such file or directory
1 | #include <gtk/gtk.h>
| ^~~~~~~~~~~
compilation terminated.
after some searching i found gtk isn't added to PATH, and i had more than one folder with "gtk" in its name :
1- (usr/include/gtk-3.0) this one has 3 sub folders:
(/gdk, /gtk and /unix-print)
2- (usr/share/gtk-3.0)
(usr/share/gtk-doc)
(usr/share/gtk-engines)
(usr/share/gtk-sourcview2.0)
(usr/share/gtk-sourcview3.0)
(usr/share/gtk-sourcview4.0)
i chose the first (usr/include/gtk-3.0) as it's the one that its gtk subfolder has the gtk.h header.
i added the path to $PATH by editing the file .bashrc adding to its bottom:
/home/teratron/.bashrc:
....
export PATH=$PATH:/usr/include/gtk-3.0
now i get the same error messages but with "gdk" instead of "gtk" from both vscode and gcc in the terminal, gdk.h is located in the subfolder gdk under gtk-3.0 that i already added to the $PATH variable.
now i didn't want to go ahead and add gdk.h to the path as well and see what else it says bc i felt maybe im not doing it right.
what should i do? isn't there one path to add to $PATH and it just works for all other gtk headers the gtk.h i included apparently calls?