Game Development Community

Threads

by Steve Bilton · in Torque Game Engine · 02/20/2008 (7:23 am) · 1 replies

Alright, so I've got some thread work running happily in Win32, and am now trying on Linux using GCC 3.4.3

The problem arises in that the class AIGA is made, but then run() is never called on the thread. I have read that -lpthread needs adding somewhere in the makefile, but I'm not too hot on this. Can anybody help with where that flag would need to go, or has anyone any pointers with what might be the issue?

Cheers

#1
02/20/2008 (9:14 am)
-lpthread is a linker flag; -l instructs the linker to link with a specific library, then pthread is the posix threads library, libpthread.so [would also work for libpthread.a, if you had that static version around].

You should add that parameter to link.libs.general, if that were your problem. Which it isn't.

If your program has successfully linked and you're suffering a problem where threads aren't correctly spawned at runtime [assuming you're not doing some dlopen nastiness], your problem probably is the code not calling run().

I would suggest that you investigate the actual flow of your program to see why it's not actually calling that run function.

Gary (-;