Xcode 4 - Time to make the leap?

cap10subtext's icon

Not having a lot of time to deal with silly issues I'm wondering if anyone would care to volunteer experiences with Xcode 4.

If I have an xcode 3.2 project which builds and I install xcode 4, should I expect it to just build properly? Or to I have to jump through a bunch of hoops?

I have a few projects I'm tinkering with and I don't want to delay them just because I decided to jump to xcode 4 before they'd worked out the bugs...

oli larkin's icon

it will probably build. personally i can't get used to xcode 4, have tried twice and gone back to 3 twice. It is still a bit buggy as well. You can install it alongside 3 though, just change the path in the installer.

I'm sticking with 3 until I have a reason not to.

cap10subtext's icon

yeah, that's been my feeling about it but wasn't sure how well founded it was.

I'm sure soon I'll be forced to upgrade because of iPhone development and I'm just wondering how and when would make sense to get it over with.

Thanks for the feedback!

Timothy Place's icon

In terms of the Max SDK, you will need to make a couple of changes to the maxmspsdk.xcconfig file, but after that everything should compile correctly.

1. Change the compiler version from

GCC_VERSION = 4.0

to

GCC_VERSION = 4.2

2. Change the SDK from:

SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk

to:

SDKROOT = /Developer/SDKs/MacOSX10.6.sdk

3. Change the deployment target from:

MACOSX_DEPLOYMENT_TARGET = 10.4

to:

MACOSX_DEPLOYMENT_TARGET = 10.6

Hope this helps,
Tim

Brad Garton's icon

TIm --

Will this:

MACOSX_DEPLOYMENT_TARGET = 10.6

preclude the objects form running on older 10.5 systems?

$Adam's icon

Hello Maxers,

the switch to XCode 4 is a bit more problematic. If you want to keep supporting PPC, you need to keep GCC 4 and the 10.4 SDK, at least as I know. As XCode 4 doesn't support GCC 4 nor SDK 10.4, you have to add this manually to XCode. Here's a really good how-to, which describes the entire process:

However, for me this didn't work with XCode 4.0.2, just with XCode 4.0, and (although I don't have Lion, so I can't confirm) I guess this would also break on XCode 4.1...

Hope this helps,
Ádám

Timothy Place's icon

I have heard reports from very credible colleagues that this, as you suspected, does not work on Lion/Xcode 4.1.

Cheers,
Tim

Timothy Place's icon

@Brad, yes, this will limit your code from running on pre-OS10.6 systems. If you want to continue to target OS 10.4 or 10.5, then you should stick to Xcode 3.

FWIW, I upgraded my computer (with Xcode 3.2.5 already installed) to Lion, and Xcode 3.2.5 seems to still work. However, I've heard that trying to install Xcode 3.x onto a Lion computer does not work. Your mileage may vary here...

best,
Tim

Brad Garton's icon

Tim --

Is it possible to set the deployment target to a lower OS version in XCode 4?

I've heard there is a way to reinstall and run XCode 3.x, but it was all rumors and such.

Timothy Place's icon

Hey Brad, I haven't any luck with it, but maybe I'm just missing the required magic incantation.

Cheers,
Tim

Charles Turner's icon

I haven't tried this, but the information seemed worth hanging on to:

HTH, Charles

Eric Lyon's icon

I just started testing Xcode 4.1 on Lion. I had to comment out the following lines in "ext_proto.h" to avoid compiler errors.

#ifndef WIN_VERSION
//int sprintf(char *, const char *, ...);
//int sscanf(const char *, const char *, ...);
#endif //WIN_VERSION

The following warning appears for projects with "~" in their path:

warning: invalid character '~' in Bundle Identifier at column 19. This string must be a uniform type identifier (UTI) that contains only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters.

After that, the compiled externals work fine on build 47449.

Eric

Timo Rozendal's icon

I just got a new laptop with lion installed on it.
I first installed xcode 4.1 and I managed to make max externals by changing some things Tim said and the Modernize Project that xcode offered. Externals that were compiled worked on Lion, but it doesn't work on my old laptop that runs leopard (and I would like to keep that backwards capability if possible)

It was not possible to select the 10.4 sdk (it's simply not included in the xcode 4 install). So, I installed xcode 3.2 in a separate dir (not 'Developer' and excluding the parts that would overwrite the xcode 4.1 installation). I used the method mentioned here: http://catacombae.blogspot.com/2011/07/installing-xcode-326-in-mac-os-x-lion.html

This works! (though you have to change the '/Developer/' paths in maxmspsdk.xconfig to the folder you have chosen.) The Externals work fine on lion and leopard.

Then I simply copied the 'MacOSX10.4u.sdk' folder from the xcode 3 install into the SDK folder of the xcode 4 install and tried again (with the original maxmspsdk.xconfig that comes with the max sdk) and that works as well (again the externals work both on lion and leopard). So I plan to use xcode 4 now for for developing externals for max.

I hope this helps someone. My only disclaimer is that I only quickly checked this and I don't know if I will encounter other problems, I'll let you know.

Timo

Charles Baker's icon

I had heard of the copying the older sdk folder into the 4.x Xcode SDK dir trick, but had not heard that it was ok to have both Xcode versions running on same 10.7 machine. Makes sense, given changing the path info and all... All this will have to wait for me to be assured my converter drivers are updated to Lion compatiability (RME fireface800) before I take the leap. wonderful info, Timo!!

Timo Rozendal's icon

you're welcome, btw my fireface 400 seems to work fine here...