How to get SDK 10.5 on XCode 4?

  • Hi,

    I just upgraded to Lion and XCode 4, because the previous version of GCC
    distributed with XCode 3 was just buggy. But I want to generate builds for
    10.5 SDK, but using the new GCC. XCode 4 installer created SDKs for 10.6
    and 10.7, how can I get the 10.5 SDK? And is it even possible to use it
    with the new GCC. I'm not using XCode for development and rather use the
    command line tools directly.

    Thanks in advance.
    Vojtech
  • On Jun 4, 2012, at 4:58 PM, Vojtěch Meluzín wrote:

    > Hi,
    >
    > I just upgraded to Lion and XCode 4, because the previous version of GCC
    > distributed with XCode 3 was just buggy. But I want to generate builds for
    > 10.5 SDK, but using the new GCC. XCode 4 installer created SDKs for 10.6
    > and 10.7, how can I get the 10.5 SDK?

    You can't.

    > And is it even possible to use it
    > with the new GCC. I'm not using XCode for development and rather use the
    > command line tools directly.

    What new GCC? Xcode 4 dropped GCC in favor of LLVM.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • >
    > What new GCC? Xcode 4 dropped GCC in favor of LLVM.
    >

    gcc -version
    i686-apple-darwin11-llvm-gcc-4.2: no input files
  • On Jun 4, 2012, at 3:58 PM, Vojtěch Meluzín wrote:

    > But I want to generate builds for
    > 10.5 SDK, but using the new GCC. XCode 4 installer created SDKs for 10.6
    > and 10.7, how can I get the 10.5 SDK?

    You'll need to build with the 10.7 SDK that comes with Xcode. You can still build apps that target 10.5 as long as you don't use any newer APIs; just set the "Deployment Target" build setting to 10.5.

    > And is it even possible to use it
    > with the new GCC. I'm not using XCode for development and rather use the
    > command line tools directly.

    Make sure to install the command-line tools when you install Xcode 4.3; they're not installed by default anymore.

    The 'gcc' tool is GCC 4.2.1 with the LLVM back-end. This is a really old GCC; Apple stopped updating it a long time ago.

    If you want the latest compiler, you'll want to use 'clang' instead. I don't know whether the command-line options are similar to GCC's; check the man page. Language-wise it supports nearly all the GCC extensions, so your code should compile with minimal work.

    —Jens
  • On Jun 4, 2012, at 5:26 PM, Michael Hall wrote:

    >> What new GCC? Xcode 4 dropped GCC in favor of LLVM.
    >
    > gcc -version
    > i686-apple-darwin11-llvm-gcc-4.2: no input files

    That's not GCC; that's LLVM-GCC, or LLVM with a GCC front-end. The real GCC was dropped from Xcode 4.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • On Jun 4, 2012, at 6:45 PM, Nick Zitzmann wrote:

    >
    > On Jun 4, 2012, at 5:26 PM, Michael Hall wrote:
    >
    >>> What new GCC? Xcode 4 dropped GCC in favor of LLVM.
    >>
    >> gcc -version
    >> i686-apple-darwin11-llvm-gcc-4.2: no input files
    >
    > That's not GCC; that's LLVM-GCC, or LLVM with a GCC front-end. The real GCC was dropped from Xcode 4.
    >
    Ah, if something is not very complex, and most of what I do isn't, I usually use a one line executable file with a gcc compile. I'll try out the clang mentioned.
    I did have to request command line tools separately with the last Xcode install as I remember.
  • On Jun 4, 2012, at 4:56 PM, Michael Hall wrote:

    >
    > On Jun 4, 2012, at 6:45 PM, Nick Zitzmann wrote:
    >
    >>
    >> On Jun 4, 2012, at 5:26 PM, Michael Hall wrote:
    >>
    >>>> What new GCC? Xcode 4 dropped GCC in favor of LLVM.
    >>>
    >>> gcc -version
    >>> i686-apple-darwin11-llvm-gcc-4.2: no input files
    >>
    >> That's not GCC; that's LLVM-GCC, or LLVM with a GCC front-end. The real GCC was dropped from Xcode 4.
    >>
    > Ah, if something is not very complex, and most of what I do isn't, I usually use a one line executable file with a gcc compile. I'll try out the clang mentioned.
    > I did have to request command line tools separately with the last Xcode install as I remember.

    Plus, you can only build Intel code in Xcode 4 -- no PPC.

    --
    Glenn L. Austin, Computer Wizard and Race Car Driver        <><
    "Where there's breath, there's hope!"
    <http://www.austin-soft.com>
  • On Tue, Jun 5, 2012 at 1:39 AM, Jens Alfke <jens...> wrote:
    >
    > On Jun 4, 2012, at 3:58 PM, Vojtěch Meluzín wrote:
    >
    >> But I want to generate builds for
    >> 10.5 SDK, but using the new GCC. XCode 4 installer created SDKs for 10.6
    >> and 10.7, how can I get the 10.5 SDK?
    >
    > You'll need to build with the 10.7 SDK that comes with Xcode. You can still build apps that target 10.5 as long as you don't use any newer APIs; just set the "Deployment Target" build setting to 10.5.

    You also need to change the deployment target for each xib file you create.

    On Tue, Jun 5, 2012 at 12:58 AM, Vojtěch Meluzín
    <meldaproduction...> wrote:
    >
    > I just upgraded to Lion and XCode 4, because the previous version of GCC
    > distributed with XCode 3 was just buggy.

    Switching from a good version of the IDE with a supposedly buggy gcc
    version to a version of the IDE that's well known for being buggy is a
    strange move when you do need to support Mac OS X 10.5 and later.
  • On Jun 4, 2012, at 6:39 PM, Jens Alfke wrote:

    > On Jun 4, 2012, at 3:58 PM, Vojtěch Meluzín wrote:
    >
    >> But I want to generate builds for
    >> 10.5 SDK, but using the new GCC. XCode 4 installer created SDKs for 10.6
    >> and 10.7, how can I get the 10.5 SDK?
    >
    > You'll need to build with the 10.7 SDK that comes with Xcode. You can still build apps that target 10.5 as long as you don't use any newer APIs; just set the "Deployment Target" build setting to 10.5.

    ... or use any of a number of Apple-provided libraries and frameworks which don't respect the deployment target setting.

    Also, good luck steering clear of "any newer APIs" without compiler assistance.

    Regards,
    Ken
  • Ok, so I installed XCode 4 and I also installed XCode 3 from my backup
    installer. Now XCode 4 conrtains the Developer stuff, SDKs etc., but only
    10.6 and 10.7 as expected. But I cannot find XCode 3 SDKs, any idea where
    they are? Or I'm not supposed to have both versions installed at the same
    moment? Let's say I installed XCode 4, how can I now build my stuff for
    10.5 SDK?
    Btw. the new compiler is more reliable than GCC? I checked the project site
    and I'm a little confused about what it actually is... seems like a simple
    wrapper for GCC to me...

    Cheers!
    Vojtech

    2012/6/5 Ken Thomases <ken...>

    > On Jun 4, 2012, at 6:39 PM, Jens Alfke wrote:
    >
    >> On Jun 4, 2012, at 3:58 PM, Vojtěch Meluzín wrote:
    >>
    >>> But I want to generate builds for
    >>> 10.5 SDK, but using the new GCC. XCode 4 installer created SDKs for 10.6
    >>> and 10.7, how can I get the 10.5 SDK?
    >>
    >> You'll need to build with the 10.7 SDK that comes with Xcode. You can
    > still build apps that target 10.5 as long as you don't use any newer APIs;
    > just set the "Deployment Target" build setting to 10.5.
    >
    > ... or use any of a number of Apple-provided libraries and frameworks
    > which don't respect the deployment target setting.
    >
    > Also, good luck steering clear of "any newer APIs" without compiler
    > assistance.
    >
    > Regards,
    > Ken
    >
    >

    --
    Cheers!
    Vojtech
    www.meldaproduction.com
  • On Jun 5, 2012, at 10:45 AM, Vojtěch Meluzín wrote:

    > Ok, so I installed XCode 4 and I also installed XCode 3 from my backup
    > installer. Now XCode 4 conrtains the Developer stuff, SDKs etc., but only
    > 10.6 and 10.7 as expected. But I cannot find XCode 3 SDKs, any idea where
    > they are? Or I'm not supposed to have both versions installed at the same
    > moment?

    If you're still using Snow Leopard, then you can have both of them installed at once, but you must install them into separate places and use the xcode-select command line tool to switch between them.

    > Let's say I installed XCode 4, how can I now build my stuff for
    > 10.5 SDK?

    You have to use xcode-select to switch to the directory tree containing Xcode 3.

    > Btw. the new compiler is more reliable than GCC? I checked the project site
    > and I'm a little confused about what it actually is... seems like a simple
    > wrapper for GCC to me…

    That is correct; LLVM-GCC is just a front-end for LLVM that accepts GCC-style command line options. I've never had any major problems with either LLVM or the old GCC. What problems were you having, exactly? Compilers are among the most heavily QA'd products in the marketplace, so actual compiler bugs are quite rare.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • On Jun 5, 2012, at 10:40 AM, Nick Zitzmann wrote:

    > That is correct; LLVM-GCC is just a front-end for LLVM that accepts GCC-style command line options.

    Not really. It's more correct to say that it _is_ GCC, just with the code generator replaced by LLVM. The parsing is 100% GCC. The benefit is that it should generate better code (and it will take advantage of future code-gen improvements in LLVM.)

    On Jun 5, 2012, at 10:45 AM, Vojtěch Meluzín wrote:

    > Btw. the new compiler is more reliable than GCC? I checked the project site
    > and I'm a little confused about what it actually is... seems like a simple
    > wrapper for GCC to me…

    The 'new compiler' is Clang, which has no code in common with GCC at all. It's an entirely new C/C++/Obj-C front-end that generates LLVM bytecode which is then converted to machine code by the LLVM compiler. The advantages include faster parsing and the ability to easily embed it in an IDE (which is how Xcode 4 does its fancy parsing-while-you-type). I'm told the implementation is a lot cleaner and more maintainable than GCC, too.

    This thread should really, really move to the xcode-users list.

    —Jens
previous month june 2012 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today