Building with Snow Leopard and Xcode 3.2

Do you need help? Ask here!

Bug reporting belongs here: http://developer.wz2100.net/newticket
Post Reply
User avatar
Vermithrax
Trained
Trained
Posts: 66
Joined: 22 May 2009, 06:34
Location: Tucson, Arizona
Contact:

Building with Snow Leopard and Xcode 3.2

Post 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.
Attachments
Warzone.png
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Building with Snow Leopard and Xcode 3.2

Post by Zarel »

I edited your post to reflect that #2 is no longer necessary, as of r8156.
dch
New user
Posts: 2
Joined: 23 Aug 2009, 07:46

Re: Building with Snow Leopard and Xcode 3.2

Post 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?
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Building with Snow Leopard and Xcode 3.2

Post 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.
User avatar
Vermithrax
Trained
Trained
Posts: 66
Joined: 22 May 2009, 06:34
Location: Tucson, Arizona
Contact:

Re: Building with Snow Leopard and Xcode 3.2

Post 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.
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Building with Snow Leopard and Xcode 3.2

Post 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.
User avatar
Vermithrax
Trained
Trained
Posts: 66
Joined: 22 May 2009, 06:34
Location: Tucson, Arizona
Contact:

Re: Building with Snow Leopard and Xcode 3.2

Post 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.
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Building with Snow Leopard and Xcode 3.2

Post 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.
User avatar
Vermithrax
Trained
Trained
Posts: 66
Joined: 22 May 2009, 06:34
Location: Tucson, Arizona
Contact:

Re: Building with Snow Leopard and Xcode 3.2

Post 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.
dch
New user
Posts: 2
Joined: 23 Aug 2009, 07:46

Re: Building with Snow Leopard and Xcode 3.2

Post 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'
Post Reply