Problem with compiling GTK3 program

view full story

http://askubuntu.com – 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 (HowTos)