Game Development Community

Compile error on Mac OS X tiger

by ISI (#0001) · in Torque Game Engine · 06/13/2005 (5:17 pm) · 7 replies

I downloaded Torque SDK and opened torque_pb_2_1.pbproj in xcode.
Then I tried to compile the engine. There are 160 errors in the result.
All of them occurs in the /engine/audio/audioDataBlock.cc, Here are some examples,
../engine/platform/event.h:127: error: 'data' was not declared in this scope
../engine/platform/event.h:127: error: expected primary-expression before ')' token
../engine/platform/event.h:127: error: a function call cannot appear in a constant-expression
../engine/platform/event.h:127: error: enumerator value for 'PacketReceiveEventHeaderSize' not integer constant

I tried RTS Starter Kit too. The errors occured in /engine/audio/audioBuffer.cc
../engine/core/resManager.h:255: error: invalid use of undefined type 'struct ResManager'
../engine/core/resManager.h:38: error: forward declaration of 'struct ResManager'

What's the problem? Does anyone know how to fix that?
(BTW: After the first time I found this problem, I installed OpenAL 1.0.13 from
http://developer.creative.com/articles/article.asp?cat=1&sbcat=31&top=38&aid=97)

Thx -Wei

#1
06/15/2005 (2:47 pm)
Ahh... I just joined... I hadn't found the forums yet....

You have to propagate the Offset definitions in engine/platform/types.h
to work with GCC 4.0.

Change the bottom of platform/types.h to look like this:

// compiler is GCC 3 with minor version greater than 4
#elif defined(TORQUE_COMPILER_GCC) && (__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)
#include
#define Offset(x, cls) _Offset_Variant_2(x, cls)
#define OffsetNonConst(x, cls) _Offset_Variant_1(x, cls)

// compiler is GCC 4
#elif defined(TORQUE_COMPILER_GCC) && (__GNUC__ == 4)
#include
#define Offset(x, cls) _Offset_Variant_2(x, cls)
#define OffsetNonConst(x, cls) _Offset_Variant_1(x, cls)

#endif
#endif

#endif //_TORQUE_TYPES_H_
#2
06/26/2005 (11:15 pm)
Yay! Thanks! It works just fine.
#3
07/29/2005 (6:35 pm)
Gee, its nice when things work. Good post. I think I still like Unity though...
#4
07/31/2005 (1:13 pm)
Whatever's going to best help you make your game, you should use. Meanwhile, Torque is going to be significantly improving on Mac (and to some extent Linux) as Paul gets to work on it...
#5
10/05/2005 (11:29 pm)
I am having the same problems as the second poster above (regarding ResManager forward definitions). I tried the solution suggested (modifying types.h) and I still get the same errors. I am using Max OSX with the standard compiler.

It might be worth noting that the code that Patrick suggested I append to the bottom of the file appeared to be more appropriate around the middle of the file, where the compiler-specific defines live. I also had to remove some extra endifs from his code snippet.

This is my first time developing for the Mac, so I'm a bit blind. Forgive my artificial dumbness, por favor.
#6
10/06/2005 (2:14 pm)
@Andy: It's important to say what version of MacOSX you're using; my guess is that you're on 10.4, and using gcc4.0 ( default compiler on 10.4 ). Gcc is pretty strict about standard compliance in C/C++ code. That's why it's balking in resManager.h. *Technically* it hasn't seen the definition of the ResManager class, so it can't (won't) judge whether C's strong typing is being violated or not. Hence the bit about a forward declaration. As for the Offset() macro, the code posted by Patrick Stein above has been rolled into the latest version of Torque. Thanks Patrick!

You can check out the latest version by downloading it from our CVS server.
CVS instructions are here, these are for Windows, but the process & settings are nearly identical for Mac.
#7
02/20/2006 (7:03 am)
I cant compile with xCode 2.2.1

please help.

Most of my errors are in compiledEval.cc (7 errors)

It says
"error: Invalid use of undefined type 'struct Resmanager'"

and another error I get is

"Command /Developer/Private/Jam failed with exit code 1"