g_thread_init undefined? (fwd)



I was trolling trough the gdk reference and found out (in small print and
easily missed):

Note: To use g_thread_init() in your program, you have to link with the
libraries, that the command "glib-config --libs gthread" outputs. This is
not the case for all the other thread related
              functions of GLib. Those can be used without having to link
with the thread libraries.

Shouldn't this be added to the faq q on threads?

Sean Cody (aka NullStream) 
umcodysw@cc.umanitoba.ca (SCHOOL)
null@fuzyscsi.dhs.org     (HOME)

"If God's my witness then God must be blind."
	Garbage - As Heaven Is Wide

---------- Forwarded message ----------
Date: Mon, 21 Feb 2000 12:46:20 -0600 (CST)
From: Sean Cody <umcodysw@cc.UManitoba.CA>
To: gtk-list@redhat.com
Subject: g_thread_init undefined?

Experimenting with threads.  Yes I read the faq and the example source
doesn't compile at all on both solaris(1.2.3) and linux(1.2.6) I get

/tmp/cc595wkr.o: In function `main':
/tmp/cc595wkr.o(.text+0xc): undefined reference to `g_thread_init'
collect2: ld returned 1 exit status

Compile Command: gcc -o t2 t2.c `gtk-config --cflags` `gtk-config --libs`

t2.c:
#include <glib.h>

int main(int argc,char **argv)
{
 g_thread_init(NULL);
}

Is there something I am missing I can't seem to figure this out.  On both
systems g_thread_init is defined in glib.h but not in libraries?

Ugeth,

Sean Cody (aka NullStream) 
umcodysw@cc.umanitoba.ca (SCHOOL)
null@fuzyscsi.dhs.org     (HOME)

"If God's my witness then God must be blind."
	Garbage - As Heaven Is Wide




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