You are not logged in.

#1 2021-07-31 05:33:02

djdols
Member
Registered: 2021-07-31
Posts: 4

C headers are all over the place

I wanted to try learning using the GTK libraries since i want to make a GUI application but there are a ton of problems.
When I #include <gtk/gtk.h> it says that file is not found
and then i found gtk/gtk,h inside a folder named gtk-3.0
so i simply changed the #include in my main C file and it got fixed

but then it still can't compile because gtk.h includes gdk/gdk.h which couldn't be found
but then i saw it in gtk-3.0 folder so i tried making a symlink of that folder in /usr/include and it got fixed

but then another problem occurs, the gdk headers use glib which again isnt in the /usr/include folder
but it is in glib-2.0

I didn't try the sym link cuz im afraid my headers might get too messy.

What do i do?

Offline

#2 2021-07-31 06:31:18

loqs
Member
Registered: 2014-03-06
Posts: 19,008

Re: C headers are all over the place

$ pkgconf -cflags gtk+-3.0
-I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread 
$ pkgconf -cflags glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

Offline

#3 2021-07-31 08:48:51

djdols
Member
Registered: 2021-07-31
Posts: 4

Re: C headers are all over the place

thanks for the answer, can i get an explanation though? im quite new to C as well

Offline

#4 2021-07-31 09:14:46

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: C headers are all over the place


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2021-07-31 10:55:20

djdols
Member
Registered: 2021-07-31
Posts: 4

Re: C headers are all over the place

thanks

Offline

Board footer

Powered by FluxBB