Hi,
I hope this is the right section to ask this…
I installed the latest gtk(4) from the git repo (ninja install
) and am now trying to compile the example application (/examples/hello-world.c
) with this command:
gcc `pkg-config gtk4 --cflags` `pkg-config gtk4 --libs` ./hello-world.c
but all I get is:
/usr/bin/ld: /tmp/ccVkr7vc.o: in function `print_hello':
test.c:(.text+0x21): undefined reference to `g_print'
/usr/bin/ld: /tmp/ccVkr7vc.o: in function `activate':
test.c:(.text+0x44): undefined reference to `gtk_application_window_new'
/usr/bin/ld: test.c:(.text+0x4d): undefined reference to `gtk_window_get_type'
/usr/bin/ld: test.c:(.text+0x5f): undefined reference to `g_type_check_instance_cast'
/usr/bin/ld: test.c:(.text+0x6e): undefined reference to `gtk_window_set_title'
/usr/bin/ld: test.c:(.text+0x73): undefined reference to `gtk_window_get_type'
/usr/bin/ld: test.c:(.text+0x85): undefined reference to `g_type_check_instance_cast'
/usr/bin/ld: test.c:(.text+0x97): undefined reference to `gtk_window_set_default_size'
/usr/bin/ld: test.c:(.text+0xa6): undefined reference to `gtk_box_new'
/usr/bin/ld: test.c:(.text+0xaf): undefined reference to `gtk_window_get_type'
/usr/bin/ld: test.c:(.text+0xc1): undefined reference to `g_type_check_instance_cast'
/usr/bin/ld: test.c:(.text+0xd3): undefined reference to `gtk_window_set_child'
/usr/bin/ld: test.c:(.text+0xdf): undefined reference to `gtk_button_new_with_label'
/usr/bin/ld: test.c:(.text+0x10e): undefined reference to `g_signal_connect_data'
/usr/bin/ld: test.c:(.text+0x12c): undefined reference to `gtk_window_destroy'
/usr/bin/ld: test.c:(.text+0x13b): undefined reference to `g_signal_connect_data'
/usr/bin/ld: test.c:(.text+0x140): undefined reference to `gtk_box_get_type'
/usr/bin/ld: test.c:(.text+0x152): undefined reference to `g_type_check_instance_cast'
/usr/bin/ld: test.c:(.text+0x164): undefined reference to `gtk_box_append'
/usr/bin/ld: test.c:(.text+0x170): undefined reference to `gtk_widget_show'
/usr/bin/ld: /tmp/ccVkr7vc.o: in function `main':
test.c:(.text+0x197): undefined reference to `gtk_application_new'
/usr/bin/ld: test.c:(.text+0x1c6): undefined reference to `g_signal_connect_data'
/usr/bin/ld: test.c:(.text+0x1cb): undefined reference to `g_application_get_type'
/usr/bin/ld: test.c:(.text+0x1dd): undefined reference to `g_type_check_instance_cast'
/usr/bin/ld: test.c:(.text+0x1f1): undefined reference to `g_application_run'
/usr/bin/ld: test.c:(.text+0x200): undefined reference to `g_object_unref'
What am I doing wrong, any suggestions?
Tuxifan