3
rated 0 times
[
3]
[
0]
/ answers: 1 / hits: 7021
/ 2 Years ago, tue, august 2, 2022, 11:26:43
I recently decided to learn gtk+, so I installed the gtk3 developement package which contains all the necessary libraries, then I just wrote a simple program test which is supposed to display a gtk window simply and compiles it with the command below :
gcc `pkg-config --cflags --libs gtk+-3.0` main.c -o test
And the problem is at link time where I'm getting undefined reference to all the functions call :(
/tmp/ccVQOyCZ.o: In function `main':
main.c:(.text+0x1f): undefined reference to `gtk_init'
main.c:(.text+0x29): undefined reference to `gtk_window_new'
main.c:(.text+0x43): undefined reference to `g_type_check_instance_cast'
main.c:(.text+0x64): undefined reference to `g_signal_connect_data'
main.c:(.text+0x70): undefined reference to `gtk_widget_show'
main.c:(.text+0x75): undefined reference to `gtk_main'
/tmp/ccVQOyCZ.o: In function `OnDestroy':
main.c:(.text+0x96): undefined reference to `gtk_main_quit'
collect2: ld returned 1 exit status
Voilà, if anyone has a solution...
More From » 11.10