Game Development Community

What do I need to compile on XCode?

by Orion the Hunter · in Torque Game Builder · 12/15/2012 (7:08 pm) · 19 replies

Alright, I see this thread a lot but I never get the right answers... Here is my problem.

I need/want to compile everything (TGB, TGB Game) under XCode but somehow it won't work. My report is:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ConditionalMacros.h:14:14: #include nested too deeply

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h:14:14: #include nested too deeply

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h:14:14: #include nested too deeply

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h:14:14: #include nested too deeply

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:68:9: Unknown type name 'SInt8'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:79:9: Unknown type name 'SInt8'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:175:3: Unknown type name 'SInt8'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:178:3: Unknown type name 'ProcPtr'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:179:3: Unknown type name 'UInt32'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:180:3: Unknown type name 'UInt32'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:187:9: Unknown type name 'UInt8'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:195:3: Unknown type name 'UInt16'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:196:3: Unknown type name 'SInt8'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:198:3: Unknown type name 'UInt32'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:199:3: Unknown type name 'UInt8'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:200:3: Unknown type name 'UInt8'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h:201:3: Unknown type name 'UInt16'

I assume I'm missing some important files but i don't know which ones and where to get them. I have TGB 1.7.6 and Xcode 4.5.2... Any help is greatly appreciated!

~AJPCEO

#1
12/15/2012 (7:26 pm)

UPDATE:


All I did was change the target to 10.4 which got rid of a ton of errors but now it's giving me a hard time about two, each of them is:

static bool setSourceRect(void* obj, const char* data) { static_cast<t2dScroller*>(obj)->setSourceRect(&getStringElementRectI(data)); return false; };
[code]

and

[code]   scroller->setSourceRect(&getSourceRect());

It's really weird... I've tried redownloading the engine but no luck.


UPDATE 2:


I noticed the "&" signs in both, and it seems like Xcode really hates those... when I tried to get rid of it, it just gave me an error about the function not being found...
#2
12/16/2012 (5:26 am)
Yeah, don't go removing ampersands. They're kinda important. Kinda.

Try a different compiler. The current codebase doesn't like LLVM very much. Choose GCC-LLVM and see how it goes.
#3
12/17/2012 (5:40 pm)
Thanks for the reply! How do I change the compiler?
#4
12/17/2012 (5:50 pm)
Never mind. Figured it out. This time it went pretty darn far but it got stuck with these errors:

Ld "../../../tgb/Torque Game Builder.app/Contents/MacOS/Torque Game Builder" normal i386
    cd /Applications/Torque2D_Pro_1_7_6/engine/compilers/Xcode
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    /Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.2 -arch i386 -L/Applications/Torque2D_Pro_1_7_6/engine/compilers/Xcode/../../../tgb -F/Applications/Torque2D_Pro_1_7_6/engine/compilers/Xcode/../../../tgb -filelist "/Users/Torque/Library/Developer/Xcode/DerivedData/Torque2D-dodwgsyijmrkymbrxcrvhvznzsoi/Build/Intermediates/Torque2D.build/Default/Torque Game Builder.build/Objects-normal/i386/Torque Game Builder.LinkFileList" -mmacosx-version-min=10.5 -lz -framework Accelerate -fobjc-link-runtime -framework AGL -framework Carbon -framework OpenGL -framework CoreFoundation -framework DrawSprocket -framework Cocoa -framework OpenAL -o "/Applications/Torque2D_Pro_1_7_6/engine/compilers/Xcode/../../../tgb/Torque Game Builder.app/Contents/MacOS/Torque Game Builder"

Undefined symbols for architecture i386:
  "pskPlatform::Mask", referenced from:
      t2dPhysics::platformCollision(float, t2dPhysics::cCollisionStatus*)in t2dPhysics.o
  "pskPlatform::isOneWay(t2dSceneObject*)", referenced from:
      t2dPhysics::platformCollision(float, t2dPhysics::cCollisionStatus*)in t2dPhysics.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
#5
12/17/2012 (6:29 pm)
That looks like the classic "compiling 64-bit app with only 32-bit libraries available" problem, except in reverse. Not sure how THAT happens.

In the Build Settings part of the target you are compiling:
  1. Intel 32-bit as the architecture.
  2. Base SDK should be the latest available.
  3. Valid Architectures should only be i386.
  4. Compiler for C/C++/Objective-C should be LLVM GCC.

Clean & build. I have 461 files building for the editor (non-debug) target, with 93 warnings. LLVM finds actual errors because it's better. Pay no attention to that for now, as a new version is close. Just live with LLVM GCC until then, since it ignores these scary errors in the code :)
#6
12/18/2012 (6:46 am)
203 errors, this time. Here are a few:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:712: 'CollectionFlattenUPP' has not been declared
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:728: 'CollectionFlattenUPP' has not been declared
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:746: 'CollectionFlattenUPP' has not been declared
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:759: 'CollectionExceptionUPP' does not name a type
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:775: 'CollectionExceptionUPP' has not been declared
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:808: 'Handle' has not been declared

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:872: 'Handle' has not been declared
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:887: 'Handle' has not been declared


/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:176: Variable or field 'DisposeCollectionFlattenUPP' declared void
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:176: 'CollectionFlattenUPP' was not declared in this scope
//Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:221: 'CollectionExceptionUPP' does not name a type
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:222: Variable or field 'DisposeCollectionFlattenUPP' declared void
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:222: 'CollectionFlattenUPP' was not declared in this scope
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:223: Variable or field 'DisposeCollectionExceptionUPP' declared void

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h:141: 'CALLBACK_API' declared as function returning a function
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:432: Invalid type argument of 'unary *'
#7
12/18/2012 (7:21 am)
No idea what your errors are then. It compiles here, with the latest Xcode and latest SDK, using LLVM GCC. If I switch to the real LLVM compiler I just get 4 errors, and none like yours.
#8
12/18/2012 (7:41 am)
Here are my build settings...


Totque2D project settings:

s8.postimage.org/thhin2m9x/Torque.png
All targets:

s14.postimage.org/55o1m4oo1/Torque2.png Anything wrong, here?

Each time I usually get:

/Applications/Torque2D_Pro_1_7_6/engine/compilers/Xcode/../../source/platform/profiler.cc Showing first 200 errors only
#9
12/18/2012 (8:50 am)
Those are my exact settings. Have you made any changes to code, other than integrating PSK? Does a plain version of 1.7.6 compile?
#10
12/18/2012 (9:46 am)
Well I did add this teeny theora code (the whole reason I compiled.) I'll see what happens if I replace the source...
#11
12/18/2012 (5:30 pm)
Same thing. Should the OSX Deployment Target be 10.4 for everything?
#12
12/18/2012 (5:46 pm)
I tried again. 325 errors, main ones are:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/CarbonCore.framework/Headers/MacTypes.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h
/Applications/Torque2D_Pro_1_7_6/engine/compilers/Xcode/../../source/platform/profiler.cc
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h
/Applications/Torque2D_Pro_1_7_6/engine/compilers/Xcode/../../source/platformMacCarb/macCarbAudio.cc
#13
12/19/2012 (9:55 am)
It seems that I've got it working! So to get TGB Pro with PSK Pro on OSX I did the following:

1) Download and install TGB Pro like normal
1a) Optional - Launch Xcode and see if you can compile the base TGB project. Open the Xcode project in the compilers folder and you should be able to compile once you change the compiler to LVVM GCC 4.2
2) Once you've verified that works download and install PSK Pro using the 'ditto' command in the readme.
3) In Xcode right click on the project in the file hierarchy and click "Add Files to Torque2D...". Choose 'engine/source/PlatformerKit' and make sure to check off all targets (not just All Targets though!) and choose to copy files if needed
4) Change your build settings to match this: i.imgur.com/80wnc.png All I had to change was Compiler to the above setting and Architecture to 32-bit Intel but double check for your system.
5) Run Product->Clean
6) Compile and you should be good! Hopefully. Maybe. That's how I got it working at least and TGB with PSK seems to be just fine now.

e: BTW I'm on a 64-bit MBP running OSX 10.7.5 and Xcode 4.5.2
#14
12/19/2012 (11:34 am)
Huh... it sorta worked. It failed, but there is an app now. I'm going to try with some modifications and see where it goes.
#15
12/19/2012 (11:37 am)
What was the failure? Different than the one I was getting?
#16
12/19/2012 (6:03 pm)
Whoohoo! It worked! I just forgot to apply your settings to everything else. Build succeeded! Thanks, Chris.
#17
12/19/2012 (7:43 pm)
No problem! The more we help each other out the more we all get done.
#18
12/20/2012 (6:26 am)
Ah, just one question. What features does compiling the source with the PSK source enable? Does it matter that I stated my project before I compiled?
#19
12/20/2012 (6:57 am)
Not unless you make drastic changes to objects in the executable that your Torquescript would call. I'm extending the capabilities of the character in the PSK so I'm adding variables and functions and other such things to the player class in C++. This is the stuff that used to be done in behaviors in older versions of the PSK. You can see that in the Legacy folder under behaviors.

I also had to recompile the project because I fixed this bug with keyups not being triggered if other keys are being held down. The fix with where to do it in the code is here