Game Development Community

Tiger -n- Torque

by Brian A. · in Torque Game Builder · 04/28/2005 (2:51 pm) · 18 replies

Has anyone had any issues with Torque2D while running the new version of MAC OS (Tiger)?

#1
04/29/2005 (8:09 am)
It doesn't release until today (and mine is arriving this morning), so I would not expect much feedback until probably after this weekend when people have time to install it.
#2
05/02/2005 (3:17 am)
I was able to test T2D on an early copy of Tiger and it ran just dandy. :) Hope there are no problems with it after release... certainly shouldn't be. I'll likely be moving my Mac dev machine over to Tiger in the next few weeks too.
#3
05/03/2005 (1:52 am)
I get these errors every time I try to build Torque2D either in the Debug or Release targets. These are from the 1.0.2 release of Torque2D running in Xcode 2.0 under Tiger. I won't pretend to know what it means though *crosses eyes*.

resManager.h:38: error: forward declaration of 'struct ResManager'
resManager.h:38: error: forward declaration of 'struct ResManager'
resManager.h:38: error: forward declaration of 'struct ResManager'
resManager.h:38: error: forward declaration of 'struct ResManager'
resManager.h:38: error: forward declaration of 'struct ResManager'
resManager.h:38: error: forward declaration of 'struct ResManager'
resManager.h:38: error: forward declaration of 'struct ResManager'
resManager.h:38: error: forward declaration of 'struct ResManager'
resManager.h:255: error: invalid use of undefined type 'struct ResManager'
resManager.h:263: error: invalid use of undefined type 'struct ResManager'
resManager.h:265: error: invalid use of undefined type 'struct ResManager'
resManager.h:278: error: invalid use of undefined type 'struct ResManager'
resManager.h:255: error: invalid use of undefined type 'struct ResManager'
resManager.h:263: error: invalid use of undefined type 'struct ResManager'
resManager.h:265: error: invalid use of undefined type 'struct ResManager'
resManager.h:278: error: invalid use of undefined type 'struct ResManager'
#4
05/03/2005 (11:20 am)
Hmm... they may have changed settings in xcode 2 before release, my preview copy was pretty early. I'll hopefully get Tiger here in the next 2 weeks.

Mean time, anybody got it working yet?
#5
05/05/2005 (4:35 pm)
Any word on this yet? I just tried compiling in XCode 2 for the first time, and got the same errors as Christopher. And I have absolutely no idea what they mean :)
#6
05/05/2005 (6:45 pm)
Ok - so I've been poking around with this for a bit, but my experience with programming at this level is pretty slim. I was able to clear up the above errors by switching the compiler from gcc 4.0 to gcc 3.3. However, this just opened up more errors (well, error).

ld: Undefined symbols:
_fprintf$LDBLStub
_sprintf$LDBLStub
_vsprintf$LDBLStub
_sscanf$LDBLStub

After some quick Google research, this mailing list thread seems to be the closest to providing an answer. However, I'm not sure how adding -lSystemStub to a makefile translates into XCode-related building, or if this is even the right way of thinking.

Anyways, it's not a huge deal - I can use a previous version of the engine that has the changes I need to make already made. Just curious if anyone has been successful building T2D in Tiger and how they went about it.
#7
05/06/2005 (5:23 am)
Saw this thread and decided to try compiling under xCode2 on 'Tiger'.
(I've not really had need to compile before as I'm starting off with TorqueScript and seeing how far I can get.)

I too got the same errors as Chris Andrade and thought I would try Chris Cockcroft's suggestion of reverting the compiler back to 3.3....but with the xCode project supplied I was never given a rules tab in the project inspector....

@Chris Cockcroft Where did you change the compiler setting?


However, I had a look around the menus and found the "Project>Upgrade to Native Target" option. Running this allowed me to see a build rules tab in the project inspector/info and then I could create a copy of the system 'c' rule and change this to use the 3.3 compiler.

Having done that (and changed the build location as per the readme) I can build with no errors (both debug and release versions)

I've tested it with both FishDemo and SpaceScroller and they both work except there is no sound...but, I'm pretty sure that this has been covered in another thread (correct me if I'm wrong).

I have very little idea why what I did works, but it does for me! Anyone else care to try it and report back?

Bri
#8
05/06/2005 (9:11 am)
...It's not quite as good as I thought...

T2D runs if launched from xCode but not from the Finder and it's a very slim 148k compared to the 8.8Mb of the 1.0.0 release.

If I change the build to deployment and do a clean build I get errors...

Okay, I'm out of ideas. Back to my scripts... ;)

Bri
#9
05/06/2005 (3:51 pm)
Ok, so I think I've figured this, after successfully building both Debug and Release builds.

1. Run ranlib on both libogg.a & libvorbis.a

2. Set the compiler to GCC 3.3. To do this, select "Project>Edit Active Target..." from the menu bar. From the window that pops up, choose "GCC Compiler Settings", and set the compiler version to GCC 3.3

3. Now choose "Project> Upgrade All Projects in Target to Native" (thanks, Brian - I had no idea about that one :))

4. Finally, choose "Project> Set Active Build Style > Deployment"

Now build - it should work. Apparently, the order is very important. Doing step 3 before step 2 will result in the "undefined symbols" errors.

I've tried this on both Debug and Release and it seems to work fine. Let me know if you try it out and manage to get it to work.
#10
05/08/2005 (10:30 pm)
Anybody had success w/ GCC 4 yet? I don't have it up on my machine yet, but I'd love to see what problems people run into.
#11
05/09/2005 (3:46 am)
Not yet I still get the resManager errors listed above. I don't know enough about C++ to know anything about forward declarations, but I'm sure you'll be able to solve the problem once you get Tiger up and running.
#12
05/10/2005 (6:41 am)
@Josh: I had another go using the 4.0 compiler. Here's what I did and what happened...

First I updated the vorbis files with ranlib
Launched xCode project.
Selected Torque2D project and used the inspector to change the build products location as per the readme.txt

Upgraded all targets to native using 'Project>Upgrade All Projects in Target to Native' option. (Not sure if this is necessary, may try again, without this step, later)

Built 'Torque2D-MacCarb-Debug (Upgraded)' using the development build style
Resulted in following errors (only first few errors shown, others are similar):

../engine/core/resManager.h: In member function 'void Resource::unlock()':
../engine/core/resManager.h:255: error: invalid use of undefined type 'struct ResManager'
../engine/core/resManager.h:38: error: forward declaration of 'struct ResManager'

Moved the class declarations for ResDictionary and ResManager to above the declaration of the Resource Template class. This eliminates the above errors. (Not sure if there are any side-effects to this)

Build now fails while compiling compiler.cc with the following errors related to the use of the Offset() macro (I think):

../engine/platform/event.h:137: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:137: error: '->' cannot appear in a constant-expression
../engine/platform/event.h:137: error: '&' cannot appear in a constant-expression
../engine/platform/event.h:137: error: enumerator value for 'PacketReceiveEventHeaderSize' not integer constant

My knowledge of C++ is not great, so I looked around the net for stuff on obtaining offsets of class members...., got scared, went home ;-)
But seriously though, I thought this might at least give you a little fore-warning of what to expect when your 'Tiger' arrives.
#13
05/10/2005 (7:18 am)
Huh, those errors looks a bit like when I've tried to access platform specific headers in packages the project doesn't seem to like ... like Carbon.h outside of platformMacCarb, etc.

Is it possible the new XCode just doesn't like the old project setup? Josh, was your early version of Tiger perhaps using the "old" version of XCode?
#14
05/15/2005 (1:19 am)
Http://www.idevgames.com/forum/showthread.php?t=9134

According to this thread on another forum I lurk on, GCC 4.0 built applications can not run on pre 10.3.9 systems.
So if we want Torque2D to work on those systems, we have to build it using GCC 3.3 regardless. I'm going to try some of the above stuff and maybe get Torque2D compiled using GCC 3.3 again.

Edit: Huzzah, Success!
#15
05/15/2005 (8:49 am)
Sounds like GCC 3.3 is the way to go. How does one swap that out in Tiger?
#16
05/15/2005 (9:50 am)
Hey Josh,

I posted a complete how-to a couple posts up. Hope it helps.
#17
05/31/2005 (9:59 pm)
The only thing you have to do to get it to compile in Tiger is change the case of a few of the includes, use GCC 3.3, and then change the release build to use -O2 and not the defaulted -O3
#18
09/01/2005 (11:53 pm)
"1. Run ranlib on both libogg.a & libvorbis.a ( I ran this as "sudo", i.e. "super user")

2. Choose "Project>Set Active Target..." selecting the build (either Debug or Release) that you are going to compile. There should be a small green checkmark on the bullseye which represents the "Active Target".

3. Set the compiler to GCC 3.3. To do this, select "Project>Edit Active Target..." from the menu bar. From the window that pops up, choose "GCC Compiler Settings", and set the compiler version to GCC 3.3

4. Now choose "Project> Upgrade All Projects in Target to Native" (thanks, Brian - I had no idea about that one :))

5. Finally, choose "Project> Set Active Build Configuration > Deployment"

Now build - it should work. Apparently, the order is very important. Doing step 3 before step 2 will result in the "undefined symbols" errors.

I've tried this on both Debug and Release and it seems to work fine. Let me know if you try it out and manage to get it to work."