Page 1 of 1

Building with Snow Leopard and Xcode 3.2

Posted: 29 Aug 2009, 00:39
by Vermithrax
Snow Leopard comes with Xcode 3.2. For those building on a Mac, bear in mind the following points:

1) Install the 10.4 SDK, even if you have already installed it with version 3.1.x of Xcode.

2) Under Project->Project Settings make sure the C/C++ compiler version is set to GCC 4.0. Otherwise it will default to GCC 4.2 which won't build.

3) Yes, textures are fixed.

Re: Building with Snow Leopard and Xcode 3.2

Posted: 18 Sep 2009, 23:18
by Zarel
I edited your post to reflect that #2 is no longer necessary, as of r8156.

Re: Building with Snow Leopard and Xcode 3.2

Posted: 19 Sep 2009, 21:00
by dch
so are we still OK with changes to teh wiki http://developer.wz2100.net/wiki/Mac_OS ... _%282.1%29 that i made recently?

I am still not clear on whether it makes a difference to compile with Debug or Release under MacOS.

are you saying i should change to gcc 4.2 or doesn't that matter?

Re: Building with Snow Leopard and Xcode 3.2

Posted: 20 Sep 2009, 01:23
by Zarel
dch wrote:so are we still OK with changes to teh wiki http://developer.wz2100.net/wiki/Mac_OS ... _%282.1%29 that i made recently?
That's fine.

Re: Building with Snow Leopard and Xcode 3.2

Posted: 20 Sep 2009, 02:44
by Vermithrax
What command line are you using to do the compilation?

I still cannot compile successfully unless I use GCC 4.0 and build for the SDK 10.4. This is using a fresh get from trunk, revision 8167.

Re: Building with Snow Leopard and Xcode 3.2

Posted: 20 Sep 2009, 03:08
by Zarel
I'm using:

xcodebuild -project Warzone.xcodeproj -target Warzone -configuration Release -sdk macosx10.4

I'm also using Xcode, although you have to remember to compile for target i386 instead of ppc.

Re: Building with Snow Leopard and Xcode 3.2

Posted: 20 Sep 2009, 03:55
by Vermithrax
Zarel wrote:I'm using:

xcodebuild -project Warzone.xcodeproj -target Warzone -configuration Release -sdk macosx10.4

I'm also using Xcode, although you have to remember to compile for target i386 instead of ppc.
Unfortunately that doesn't work either for the following reason (error generated by attempted compilation):

GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file autorevision.cpp)

So you're probably still building with GCC 4.0.

Re: Building with Snow Leopard and Xcode 3.2

Posted: 20 Sep 2009, 04:04
by Zarel
Vermithrax wrote:Unfortunately that doesn't work either for the following reason:

GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file autorevision.cpp)

So you're probably still building with GCC 4.0.
Hrm. Maybe Xcode is caching that manually. See if deleting everything, checking out r8167, and trying again fixes everything.

PLEASE TELL ME WHETHER OR NOT THAT WORKS.

That said, if it doesn't work, after telling me, do the crossed out step 2 in the first post.

Re: Building with Snow Leopard and Xcode 3.2

Posted: 20 Sep 2009, 04:41
by Vermithrax
No, that doesn't work. I get errors akin to the following:

In file included from /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEventsCore.h:24,
from /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/HIObject.h:28,
from /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/HIToolbox.h:25,
from /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:29:
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/HIGeometry.h:94: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'HIGetScaleFactor'
In file included from /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h:24,
from /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/HIToolbar.h:28,
from /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/HIToolbox.h:37,
from /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:29:
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Appearance.h:2758: error: expected declaration specifiers or '...' before 'URefCon'

Building from the Xcode GUI doesn't have any problems. When I check the project settings, it states SDK 10.4 and GCC 4.0.

If I switch to GCC 4.2 and SDK 10.5 I get the same errors as above.

Re: Building with Snow Leopard and Xcode 3.2

Posted: 20 Sep 2009, 13:52
by dch
here's my working setup under macos x 10.6 (upgrade from tiger)

under xcode building fine:
xcode 3.2 compatible
output i386
base sdk macos x 10.4
gcc 4.0

but when changing to gcc 4.2 I get this:
=== BUILD NATIVE TARGET Autorevision OF PROJECT Warzone WITH CONFIGURATION Release ===
Check dependencies
GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file autorevision.cpp)
GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file autorevision.cpp)
** BUILD FAILED **

some useful aliases incl the "make clean" - maybe this will help you?

Code: Select all

wz='/Applications/Warzone.app/Contents/MacOS/Warzone --debugfile ~/Desktop/warzone.log --fullscreen  --resolution 1920x1200'
wzc='cd ~/src/warzone2100/ ; svn up; cd trunk/macosx/ ; xcodebuild clean; xcodebuild -project Warzone.xcodeproj -target Warzone -configuration Debug'
wzd='gdb --args /Applications/Warzone.app/Contents/MacOS/Warzone --debug all --debugfile ~/Desktop/warzone.log --resolution 1600x1000 --window'
wzf='/Applications/Warzone.app/Contents/MacOS/Warzone --debug all --debugfile ~/Desktop/warzone.log --fullscreen  --resolution 1920x1200'