Game Development Community

[SOLVED] Linux Semaphore Compiler Issues

by Daniel Minion · in Torque Game Builder · 07/29/2010 (10:07 pm) · 7 replies

Hello,

I have been messing around with torque the past few hours trying to get it to compile under Linux. However I've hit a bit of a snag.

When it gets to x86UNIXSEMAPHORE.cc it spits out quite a few errors and I am unsure on how to proceed.

Quote:

--> Compiling platformX86UNIX/x86UNIXSemaphore.cc
platformX86UNIX/x86UNIXSemaphore.cc:14: error: redefinition of ‘static void* Semaphore::createSemaphore(U32)’
./platform/threads/semaphore.h:37: error: ‘static void* Semaphore::createSemaphore(U32)’ previously defined here
platformX86UNIX/x86UNIXSemaphore.cc:14: error: cannot declare member function ‘static void* Semaphore::createSemaphore(U32)’ to have static linkage
platformX86UNIX/x86UNIXSemaphore.cc:22: error: redefinition of ‘static void Semaphore::destroySemaphore(void*)’
./platform/threads/semaphore.h:42: error: ‘static void Semaphore::destroySemaphore(void*)’ previously defined here
platformX86UNIX/x86UNIXSemaphore.cc:28: error: redefinition of ‘static bool Semaphore::acquireSemaphore(void*, bool)’
./platform/threads/semaphore.h:48: error: ‘static bool Semaphore::acquireSemaphore(void*, bool)’ previously defined here
platformX86UNIX/x86UNIXSemaphore.cc:46: error: redefinition of ‘static void Semaphore::releaseSemaphore(void*)’
./platform/threads/semaphore.h:54: error: ‘static void Semaphore::releaseSemaphore(void*)’ previously defined here
make[1]: *** [out.GCC4.DEBUG/platformX86UNIX/x86UNIXSemaphore.obj] Error 1
make: *** [default] Error 2

That is what is spit out of my compiler. I am using GCC 4.4.3 in Lucid Lynx.

Could anyone offer some insight on why this is happening?

Thanks in advance.

EDIT: Solved by redefining class within x86UNIXSemaphore

-Dan

About the author


#1
07/29/2010 (10:31 pm)
You got TGB to compile on Linux? That's cool, where'd you get the source?
#2
07/29/2010 (10:44 pm)
Almost compile :P All the code has been fully compiled, but now Im having a fair amount of linker issues, but that should be easy to solve.

You get the source with any Torque Game Builder Pro license. In there is build paths for Linux.
#3
07/30/2010 (4:08 pm)
Huh, never noticed Linux code in there. So are you borrowing someone's TGB Pro license to do this?
#4
07/30/2010 (8:39 pm)
I am using the license I have at my job, yes.

Its not even funny how much Unix code is missing in here. All the directory stuff, dialogs (open, save, etc) all missing. Will have to do a lot of fixing to get this to work, but if we get it working, the community will have a working linux version :)
#5
08/02/2010 (6:23 am)
Great news if you can fix it :)

Even getting the TGE versions that used to work to compile is a pain in recent Linux distros. TGB being available for only the other two platforms so long has made it worse. Post a diff when you're done!
#6
08/02/2010 (9:26 pm)
Hey, I hope I can :)

Is there some sort of giant Torque repo somewhere for the diff file? Or is there some way to generate one? Never used diffs without a repo before.

Just a few linker issues left now. Knowing my luck though I will get a binary and nothing will work :P But, I'll keep at it, maybe we'll push for an official fix from GG.
#7
08/02/2010 (10:16 pm)
You can generate a diff from the source tree and just post a link. We know how to use patch to sort the rest out :)