Problems using pkg-config (with GTK+) in codelite
Posted: Wed Sep 22, 2010 10:41 am
Well hi, my problem is that i want to use GTK+ library in my project, i made a very little program to check if i configured codelite settings in the right form, here is my code (very short):
ok, i'm using pkg-config to link libraries, so using the last version of codelite (revision 4375) i put the next into the project->settings->compiler , in compiler options :
$(shell pkg-config --cflags --libs gtk+-2.0)
the i build the project but it gives me:
i really don't realized why it doesn't work, any help will be very appreciated.
Thanks a lot.
Code: Select all
#include <gtk/gtk.h>
int main( int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
gtk_main();
return 0;
}
$(shell pkg-config --cflags --libs gtk+-2.0)
the i build the project but it gives me:
Code: Select all
----------Build Started--------
/bin/sh -c '"make" -j 1 -f test_wsp.mk"'
----------Building project:[ testing - Debug ]----------
make[1]: Entering directory `/home/test/.codelite/hw/testing'
gcc -o ./Debug/testing ./Debug/main.o "-L."
./Debug/main.o: In function `main':
main.c:(.text+0x17): undefined reference to `gtk_init'
main.c:(.text+0x23): undefined reference to `gtk_window_new'
main.c:(.text+0x33): undefined reference to `gtk_widget_show'
main.c:(.text+0x38): undefined reference to `gtk_main'
collect2: ld returned 1 exit status
make[1]: *** [Debug/testing] Error 1
make[1]: Leaving directory `/home/test/.codelite/hw/testing'
make: *** [All] Error 2
----------Build Ended----------
0 errors, 0 warnings
Thanks a lot.