gnome and pthreads



Hi,

I've got a code snippet in my main.c that looks like this:

       g_thread_init(NULL);
       gdk_threads_init();
       gtk_init(&argc, &argv);

       ...

       gdk_threads_enter();
       gtk_main();
       gdk_threads_leave();

This is supposed to set up the ability to use Gnome in a threaded application. Trouble is I'm getting link errors when I try to build it:

gcc `gnome-config --libs gnome gnomeui` -L../src -o sip callbacks.o gui.o log.o main.o ringback.o -lsip -lpthread
main.o(.text+0x10a): In function `main':
: undefined reference to `g_thread_init'
main.o(.text+0x112): In function `main':
: undefined reference to `gdk_threads_init'
collect2: ld returned 1 exit status
make: *** [all] Error 1

The interesting thing I'm not getting undefine'ds for gdk_threads_enter() and gdk_threads_leave(). I would luv it if I could get some advice on this from someone.

Thanks in advance,
FM





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]