Game Development Community

Hundreds of errors, thousands of warnings when compiling a game to simulator

by Johnny Sprada · in iTorque 2D · 05/21/2009 (10:55 pm) · 10 replies

Hi all,

Today I've been attempting to compile my first game to the simulator. I've tried the walk through in the documentation, and the demo games that shipped with iTGB. I keep getting similar errors and warnings.

The main errors are:

stdarg.h No such file or directory
float.h <stdarg.h>

Tons of warnings, like unused variables. comparing a signed and unsigned integers, etc.


I bought a brand new Mac Mini today, did a software update to OS 10.5.7, downloaded the iPhone SDK, and downloaded a fresh copy of iTGB 1.2.

The demo, in the documentation has a couple discrepencies, mainly in the window used for copying resources. When I add my game folder, common folder, and main.cs script, I'm prompted to choose from cecking the following boxes:

iTGB
iTGB_Optimize
iTGB_Script
iTGB_Script_Optimize

I've tried each, unsuccessfully. Each gives the same result.

I'm guessing that I've overlooked something quite obvious.

Thank you for the help,
Johnny




#1
05/22/2009 (3:55 am)
The errors you get are very strange. Do any regular projects from Apple's templates compile at all? You shouldn't be getting messages like that unless Xcode and the SDKs aren't installed correctly.

About targets: Tick all of them, because every different binary is going to need the data directories.
#2
05/22/2009 (8:09 am)
Hi Ronny,

Thank you for taking the time to respond. I have been able to successfully compile and run iTGB, using the non-iPhone Xcode project. I couldn't figure out where the target .app went, but at least it ran. So I assume that my compiler, and xCode is working as it should, or at least for the most part.

I tried compiling an app for the iPhone again (iTGB game)
This time, I've added my resources, and ticked all four options before adding them.

Before I build, though, I can only tick a single target (from the drop down list). Depending on which target I choose, and whether I choose Debug, or Release, I get different results while compiling. In some cases, it gets through the entire compiling process without any errors (over 5,000 warnings) and the iPhone simulator launches, but is blank, and an error displaying that the application failed to launch.

I really appreciate our efforts in helping me, as I'm really stuck!

Thank you,
Johnny
#3
05/22/2009 (9:12 am)
OK, I can get my games to run in the simulator, only if I build the iTGB_Optimze option though.

Should the other options work?

Can anyone please explain what these different options are for? It's quite confusing, especially with the lack of documentation.

Thank you,
Johnny
#4
05/22/2009 (9:22 am)
OK, I found this info in the iTGB distribution.

iTGB
Otherwise normal configuration with with USE_COMPONENTS enabled

iTGB Optimize
PUAP_OPTIMIZE enabled, but otherwise the same as iTGB

iTGB Script
PUAP_SCRIPT_CHANGE enabled, but otherwise the same as iTGB

iTGB Script Optimize
PUAP_SCRIPT_CHANGE and PUAP_OPTIMIZE enabled
#5
05/22/2009 (11:29 am)
Builds with PUAP_OPTIMIZE are recommended, and PUAP_SCRIPT_CHANGE makes and expects different compiled script, so the .dso files from each don't work with the other type of executable.

Here's how you theoretically should get it working perfectly:
1.Build a TGB Game.app and Torque Game Builder.app with exactly the same flags as the preferred iPhone targets (PUAP_SCRIPT_CHANGE+PUAP_OPTIMIZE in the case of iTGB_script_optimize).
2.Install them in the right places under the tgb directory (the game goes in gameData or something).
3.Clean all DSOs everywhere.
4.Clean all iPhone & simulator targets before doing the first build after all of the above.

The editor should now produce compatible compiled scripts when running or building.

Summarised from an included readme:

PUAP_OPTIMIZE exists mostly to make games iPhone-friendly. Physics default to off, for example. You need to enable physics specifically for each object that needs it (and objects mounted to such objects).

Some GUI redraw optimisations also happen with this flag enabled. Using the flag on the desktop build gives you fewer surprises in behaviour.

PUAP_SCRIPT_CHANGE is a speed optimisation for scripts. All scripts must be compiled with an app made with this flag enabled for an iPhone app with the flag enabled to read them.

The USE_COMPONENTS flag should always be there, since you'll want to prepare for script porting. It adds the onAddToScene() and onUpdate() methods to SimComponents. The former can be handy for a lot of things, while the latter is used with caution.
#6
05/22/2009 (2:39 pm)
Can everybody build the release configuration of the iPhone project without any errors? I'm able to build the debug configuration no problem, it's just that the release is causing a headache. I've switched Michael Perry's code sign out of it, and I've also added an R to "TORQUE_DISABLE_MEMORY_MANAGER".

The errors that I'm seeing are similar to what Johnny described:

Can't find stdarg.h,float.h,xmmintrin.h, etc.

I tried to build against stock iTGB1.2 with and without the codesign and preprocessor definition changes but I received the same errors.
#7
05/23/2009 (1:43 am)
I've had the codesigning rounddance (and my legs are tired), but all my targets build. The Release build was tricky at first, but cleaning targets and restarting Xcode always does the trick for me, once I've removed whatever it is that it doesn't like. Just make sure you're using Xcode 3.1.2, not the beta.

My process when downloading a new iTGB version:
-Remove Perry's files from the Xcode project bundle
-Remove CODE_SIGN and PROVISIONING lines from the remaining project file
-Open in Xcode
-Switch Thumb code off
-Set my provisioning stuff for all targets
-Correct typo(s)
-Build & sign debug+release targets I expect to use in the iPhone project
-See that each installs on the device (don't care if scripts don't run yet for two of them)
-Make the Mac binaries with same flags as the two targets I'm going to use
-Compress the iTGB directory with tar+bzip2 for safekeeping
-Opt-drag the directory to make a copy for actual use

Between each of these steps, Xcode may decide to screw up somewhere. I've even had it flat out crash after leaving the Build options a few times. It's frustrating, but there are many beta factors for me. Since I run iPhone OS 3.0 and Apple do not allow downgrades, I'm also seeing even the launchpad crash frequently.
#8
05/23/2009 (10:19 am)
Thanks Ronny, can you elaborate more on:

Quote:-Remove Perry's files from the Xcode project bundle
I haven't seen that mentioned anywhere in the forums, can you give more specifics?

Quote:-Correct typo(s)
Just the TORQUE_DISABLE_MEMORY_MANAGER typo? Or are there others?

I created a different thread to track my problems specifically instead of taking over this thread.

Edit: I just had an idea, Ronny, can you send me your clean xCode iPhone xcodeproj that you created right before you made a copy of it? It sounds like it's something that I'm not doing correctly and with yours I will be able to compare.
#9
05/23/2009 (2:09 pm)
Removing the traces of Michael:

Right-click the project bundle and choose "Show package contents". You'll see three files now, two of which are user settings for his system. They won't be loaded by Xcode under your account anyway, so just remove them. Then open the final project in a text editor and look for the lines with his name in, and the ones starting with PROVISION. Removing those should make the project clean enough, and it will now be safe to open it (for the first time) in Xcode.

I left the typo comment open for expansion, in case they decide to add more future typos ;)
But yes, it's just the memory manager thing for now (and really only in one target).

My clean project takes a lot of space, even tarballed and compressed. A bit too big for my puny bandwidth. Besides, making it work is part of the learning experience :)
(Plus I'm still messing about with it - not always doing things in the right order, so I think I'm going to start over *again* when I feel up to it!)
#10
05/31/2009 (7:33 am)
I was having all the same errors. The optimize one is the only one that seems to work. Further I needed to be on the optimize settings before adding the common, game and main.cs from the example tutorial or I would get some kind of initialize error saying the common was corrupt in the simulator. Just adding the files with references to all 4 build types does not seem to work.