Re: Using threads in GTK, C++



On Sat, 2006-04-22 at 16:21 -0400, Mario Segura wrote:
> Hi,
> 
> I am trying to using threads in my application, but I got a compile
> error.
> 
> Output when running make:
> 
> /tmp/ccSe3rZY.o: In function
> `Glib::thread_init(_GThreadFunctions*)':principalgui.cpp:(.gnu.linkonce.t._ZN4Glib11thread_initEP17_GThreadFunctions[Glib::thread_init(_GThreadFunctions*)]+0xd): undefined reference to `g_thread_init'
> collect2: ld returned 1 exit status
> make: *** [principalgui] Error 1
> 
> The documentation shows that i need to LINK with the libraries that
> pkg-config --libs gthread-2.0 shows. I havent link the 3 libraries
> that shows that output (-pthread -lgthread-2.0 -lglib-2.0) because I
> dont know that link means in this context. I dont know if i had to
> compile them, include them in my #include statements or what to do.

You need to tell the linker to use these libraries.

It's easy if you use pkg-config or PKG_CHECK_MODULES. Just add
gthread-2.0 to your list of needed modules, such as gtkmm-2.4.


-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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