22

I am having Xcode 4.4 on OS X Lion. I'd like to install the Mac 10.6 SDK - also known as macosx10.7 SDK - because I need to compile openFrameworks.

I found that I need to download additional tools from this site. However I didn't find any 10.6 SDK there. I also tried looking in Xcode Preferences -> Downloads -> Components, but there is no way.

I am wondering how can I install previous SDKs for Xcode?

Bongs
  • 5,502
  • 4
  • 30
  • 50
goodolddays
  • 2,595
  • 4
  • 34
  • 51

5 Answers5

47

Unfortunately, Apple tends to make this much harder than you'd like. You can't download SDKs by themselves. They come as part of specific versions of Xcode. So you have to download the right version of Xcode. Search for "10.6", and you'll see that you want Xcode 4.1.

Once you download that, you can install it (that version will go into /Developer, so it won't break your /Applications version), or you can open up the package and find the SDKs in it. If you don't know how to crack open these packages, just install it.

Once you do that, search for "MacOSX10.6.sdk". I forget exactly where it is in that particular version.

What I do at that point is copy the sdk into a /SDKs directory. That way I always have them all.

Now, you need to add it to your current version of Xcode. You can do that by making symlinks in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs. If you like, you can use my tiny link-sdks script for that.


UPDATE: In modern versions of Xcode (7.3+) to use older SDKs edit MinimumSDKVersion here:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
gblazex
  • 49,155
  • 12
  • 98
  • 91
Rob Napier
  • 286,113
  • 34
  • 456
  • 610
  • 10
    on 10.8 apple will not let you run the installer for the old version of xcode however you can open up a terminal and expand the package file and then find the sdk manually. pkgutil --expand InstallXcode.pkg path/to/expand – Johan Apr 14 '13 at 16:05
  • 1
    Be careful with the first version of 4.1. It has bunch of errors in header files (for example, you may run into missing std::wstring or std::basic_string), so instead of using the first version that includes 10.6, you may want to look for the last version of Xcode that still includes 10.6. – Paul Kulchenko Sep 08 '13 at 16:54
  • 1
    Copying `MacOSX10.7.sdk` from Xcode 4.3.3 to Xcode 5.1.1 removes the warning that the 10.7 SDK is no available. – Pro Backup Aug 13 '14 at 00:56
  • Editing Info.plist broke my Xcode installation, so I had to reinstall :( – Eldamir Jul 30 '20 at 07:18
16

All legacy MacOS SDKs can be found on GitHub - https://github.com/phracker/MacOSX-SDKs

tim-montague
  • 16,217
  • 5
  • 62
  • 51
3

If you search the openFrameworks forums, there are a few posts where people are providing download links from their public Dropbox folders, for example.

jesses.co.tt
  • 2,689
  • 1
  • 30
  • 49
  • 2
    Thank you, here is a link showing how to do all the stuff: http://forum.openframeworks.cc/index.php/topic,10343.msg47100.html#msg47100 – goodolddays Aug 17 '12 at 12:10
3

Somewhat off topic, but I hit a very similar problem trying to install Erlang using kerl.

Everything worked for me until the "kerl build ..." step. The build log showed the following error:

odbcserver.c:117:10: fatal error: 'sql.h' file not found #include "sql.h"

The problem is that the ODBC is no longer part of the Mavericks installation(i.e., MacOS 10.6 SDK isn't installed). Piecing together advice from a variety of sites, none of which worked by themselves, the following set of steps fixed the issue:

  1. brew install unixodbc - installs the missing ODBC libraries and include files (e.g., sql.h).
  2. Set CFLAGS to point to the include directory for the unixodbc installation as part of the kerl build command (e.g.,):

    CFLAGS="-I/usr/local/Cellar/unixodbc/2.3.2/include" ./kerl build R15B R15B

This points the build to the ODBC include files.

My environment is Mavericks, the xcode command line tools, and xcode v5.1.1.

Rich
  • 658
  • 1
  • 9
  • 18
2

Some SDK(with Xcode) you can download from direct links. List here: http://iphonesdkdev.blogspot.ru/2010/04/old-versions-of-iphone-sdk.html

Some don't work, but something you can still download. For example: http://adcdownload.apple.com/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg

Vladislav
  • 165
  • 1
  • 5
  • 15