XCode 4, standard process?

AudioMatt's icon

I'm trying to build simplemax in xcode 4 and I'm getting some errors/warnings.

warning: The specified SDK “Current OS X” does not appear to have all of the necessary headers installed. Update your project to use a built-in SDK (“Latest OS X” is recommended) or install the system headers (included with the “Command Line Tools” package) from the “Downloads” pane in the Xcode preferences.

and

In file included from /Users/MattUser/Documents/Music Documents/Max docs/CDEV/MaxSDK-6.0.4 2/examples/basics/simplemax copy/../../../c74support/max-includes/ext_prefix.h:112:
/Developer/Headers/FlatCarbon/MacTypes.h:1:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include 

Is there a standard procedure to making external projects work in xcode 4? I've tried some stuff I saw kicking around the forums but nothing seems to have worked.

AudioMatt's icon

...or to put it more succinctly, What's up with Max and Xcode 4?

(sorry I'm an impatient child)

nealriley's icon

I had to install the Command Line Tools first (Open Xcode > Preferences > Downloads > Install Command Line Tools) and then Reboot Xcode. Does that fix it for you?

AudioMatt's icon

Hrm. Doing this seems to have increased my issue count to 4. Again I'm just trying to open and compile dummy.xcodeproj .

Xcode 4.6
OSX 10.8.2

MacTypes.h
Semantic Issue:  Typedef redefinition with different types ('unsighned long' vs 'unsigned int');
Semantic Issue:  Typedef redefinition with different types ('long' vs 'int');

strings.h
#warning Directive: Strings.h is not available on Mac OS X

dummy.c
Semantic Issue:  Using the result of an assignment as a condition without parentheses
AudioMatt's icon

uninstalled Xcode 3. Now it's

ext_path.h
Lexical or Preprocessor Issue:  'Files.h' file not found

UG!!!!!

AudioMatt's icon

threw away Mac/Developer, uninstalled Xcode 4, reinstalled Xcode 4. Error persists:

ext_path.h
Lexical or Preprocessor Issue:  'Files.h' file not found
AudioMatt's icon

THANK YOU NICOLAS!!!!!! Gosh did I really not try just commenting out the offending code?! I guess Files.h sounds pretty important.

Well, I hope cycling updates the SDK so no one else has this problem.

crsrmnr's icon

Hi,
I had the

MacTypes.h
Semantic Issue:  Typedef redefinition with different types ('unsighned long' vs 'unsigned int');
Semantic Issue:  Typedef redefinition with different types ('long' vs 'int');

problem, switching the base SDK from osx 10.8 to 10.7 fixed it for me. Not sure if Xcode installs 10.7 if you've just downloaded it however.

nick rothwell | project cassiel's icon

Seconded, in Xcode 4.6.1 (this is my first encounter with Xcode for a couple of years): switching target SDK from 10.8 to 10.7 removes this problem, but leaves me with this (when compiling the simplemax example); the build seems to work, though.

Oh, the ruby-based build script seems completely broken: I get parse errors from a pile of core #includes. I'll investigate.

In file included from :158:
In file included from :3:
In file included from /Users/nick/Desktop/MaxSDK-6.1.1/examples/basics/simplemax/../../../c74support/max-includes/macho-prefix.pch:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:65:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/Developer/Headers/FlatCarbon/strings.h:1:2: warning: Strings.h is not available on Mac OS X [-W#warnings]
#warning Strings.h is not available on Mac OS X

nick rothwell | project cassiel's icon

As a complete aside: how much is the Max SDK dependent on Carbon?

(Oh, sorry: following this thread in reverse. QuickTime.h seems to bring in Carbon.h so commenting out in macho-prefix doesn't help.)

nick rothwell | project cassiel's icon

OK... at least some of the grief is caused by having old installations of Xcode 3.x having around in /Developer. The Xcode 4 builds seem pretty clean on my Mac Pro which has never seen Xcode 3 (the Ruby build works as well). The culprit seems to be the binding to HEADER_SEARCH_PATHS in maxmspsdk.xcconfig, so taking the first path element out of this also fixes the problem (and also seems to enable a different set of build options such as earlier OS X SDKs, which is rather weird).

Next up: try to get this all working with the MaxSDK as a Git submodule.

Timothy Place's icon

Regarding the ruby build script, you need to make sure you have installed the command-line tools from Xcode's preferences window as documented @ https://cycling74.com/sdk/MaxSDK-6.1.1/html/chapter_platform.html

That said, I am personally still on Xcode 4.6 because I was told by a colleague that updating to 4.6.1 caused him many problems. I guess this means it's time for me to update and sacrifice more hours of productivity at the Apple altar of "progress".

Timothy Place's icon

Quick update: First attempt for me after updating Xcode 4.6.1, on OS 10.8.3, using the system-installed Ruby ( ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0] ) is building fine.

nick rothwell | project cassiel's icon

4.6.1 seems to work fine for me (including the Ruby build) once I nuked 3.x.