Re: pthreads + gtk



NavEcos wrote:

First the example "gtk-thread.c" doesn't compile with the command they advertise, but it works with the additional library added "gdk-x11-2.0"

$ gcc gtk-thread.c -lgdk-x11-2.0 `gtk-config --cflags --libs gthread`


If you're using GTK 2.0, which it looks like you should be, then the
command to compile would be:

$ gcc -o gtk-thread gtk-thread.c `pkg-config --cflags --libs gtk+-2.0`


But it fails with g++

$ g++ gtk-thread.cpp -lgdk-x11-2.0 `gtk-config --cflags --libs gthread`
thread.c: In function `int main (int, char **)':
thread.c:99: `gdk_threads_init' undeclared (first use this function)
thread.c:99: (Each undeclared identifier is reported only once for each
function it appears in.)


Hmm, the mixing of GTK+ 1.2 and 2.0 is probably causing this problem.
Try using one or the other, but not both (in other words, gtk-config
if you're using 1.2, or pkg-config if you're using 2.0).

Chris
--
chris wareham iosystems co uk (work)
cwareham btinternet com (home)




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