Git1
Very Active Member
- Joined
- Dec 23, 2020
- Messages
- 282
G'day folks,
So I'm trying to get into gtk in C, but am getting odd errors when compiling just the 'Hello World' examples from gtk.org here and here.
With a copy/paste of the second example, I get the following output:
I've tried with gtk3 and 4, but get similar results. Is it a missing library or something perhaps? I'm on Ubuntu 22.04 and have installed the dev packages for both 3 & 4.
Any help is appreciated.
So I'm trying to get into gtk in C, but am getting odd errors when compiling just the 'Hello World' examples from gtk.org here and here.
With a copy/paste of the second example, I get the following output:
$ gcc $(pkg-config --cflags gtk4) -o hello-world-gtk hello-world-gtk.c $(pkg-config --libs gtk4)
hello-world-gtk.c: In function ‘main’:
hello-world-gtk.c:37:49: error: ‘G_APPLICATION_DEFAULT_FLAGS’ undeclared (first use in this function); did you mean ‘G_APPLICATION_GET_CLASS’?
37 | app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| G_APPLICATION_GET_CLASS
hello-world-gtk.c:37:49: note: each undeclared identifier is reported only once for each function it appears in
I've tried with gtk3 and 4, but get similar results. Is it a missing library or something perhaps? I'm on Ubuntu 22.04 and have installed the dev packages for both 3 & 4.
Any help is appreciated.
