Hello.
I use Ubuntu 11.10 x86-64 and tried to compile a simple Gtk+ 2.0 program using:
Code:
gcc `pkg-config --libs --cflags gtk+-2.0 glib-2.0 gthread-2.0` main.c -o main
The program is:
Code:
#include <gtk/gtk.h>
#include <glib.h>
int main(int argc, char **argv)
{
GtkWidget *window;
g_thread_init(NULL);
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
But still, I get the following errors:
Code:
main.o: In function `g_once_init_enter':
/usr/include/glib-2.0/glib/gthread.h:350: undefined reference to `g_once_init_enter_impl'
The development packages for Gtk+ are installed. Please help, the same program compiles and links on other systems.
Bookmarks