gdk_threads_init()




I've been trying to get threads initialized for weeks. I'm really banging my head against a wall and its getting bloody. I have following code snippet:

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

       gtk_entry_set_text(GTK_ENTRY(localUserEntry), local_uri.user);
       gtk_entry_set_text(GTK_ENTRY(localHostEntry), local_uri.host);
       memset(s, 0, 32);
       sprintf(s, "%d", local_uri.port);
       gtk_entry_set_text(GTK_ENTRY(localPortEntry), s);
       gtk_entry_set_text(GTK_ENTRY(visibleEntry), visible_ipaddr);

       gtk_entry_set_text(GTK_ENTRY(remoteUserEntry), remote_uri.user);
       gtk_entry_set_text(GTK_ENTRY(remoteHostEntry), remote_uri.host);
       memset(s, 0, 32);
       sprintf(s, "%d", remote_uri.port);
       gtk_entry_set_text(GTK_ENTRY(remotePortEntry), s);

       GDK_THREADS_ENTER();
       gtk_main();
       GDK_THREADS_LEAVE();

This is in my main routine. The trouble is, I cannot for the life of me get the gdk_threads_init() routine to compile. I have

#include <gdk/gdk.h>

at the top of the file and I still get an:

gcc -c -Wall `gnome-config --cflags gnome gnomeui` `pkg-config gthread-2.0 --cflags` -I../include -o main.o main.c
main.c: In function `main':
main.c:60: warning: implicit declaration of function `gdk_threads_init'

When I try to build I get:

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


Can anyone see what I'm doing wrong here?

Thanks,
FM






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