17

For some reason, this information is difficult to come by.

We'd like to start using some of the C++0x features that are available in most compilers. But we are held back a bit by XCode 3, since it only provides GCC 4.2 and LLVM 1.5. All of the other platforms we need to support either already have compilers with preliminary support for C++0x features, or they have a relatively painless method of installing/upgrading the compiler.

An XCode 4 preview is available, but only to those in the Mac or iOS Developer Program.

leedm777
  • 23,444
  • 10
  • 58
  • 87
  • 5
    The information is difficult to come by because Xcode 4 is pre-release software and covered by an Apple NDA. – Abizern Dec 08 '10 at 18:34
  • 1
    According to [Apple's developer site](http://developer.apple.com/technologies/tools/whats-new.html#llvm-compiler), LLVM in XCode 4 is some version >= 2.0. However, no information whatsoever on GCC. – wkl Dec 08 '10 at 18:35
  • 1
    I sure hope they are up to LLVM 2.8, which includes `clang++` (the new C++ compiler). – Nate Dec 08 '10 at 19:14
  • 3
    It is a given that any GCC shipped by Apple will be based on GCC 4.2, the last version that has a GPLv2 license. You can expect that llvm-gcc will be very much in sync with the GCC 4.2 that Apple ships at the same time. Apple's LLVM releases are not tied to the LLVM release schedule, which is scheduled roughly twice a year, not tied to anybody's schedule in particular. See http://clang.llvm.org/cxx_status.html for status of Clang's C++0x support status. Patches are welcome to add additional features. – ohmantics Dec 09 '10 at 08:52
  • Well during a project with some collegues we had to develop an application in cpp using also some features of 0x... well we were working on mac and XCode platform were available. We had so many problems that was impossible to correctly compile a simple program using standard approaches while all other collegues (using gcc on linux) had no problems with the same code. XCode compiler(s) work differently by ordinary gcc/unix based compilers (especially for templates. If you are not bound to a specific arch then install a virtual machine using ubuntu and g++ and everything will work. – Andry Dec 24 '10 at 17:30

4 Answers4

7

Xcode 4 GM

gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
Apple clang version 2.0 (tags/Apple/clang-134) (based on LLVM 2.9svn)
Trung Lê
  • 5,188
  • 5
  • 27
  • 26
1

You can use a later gcc version in Xcode 3. I did it once, however I don't fully remember how; I used a gcc I built myself from the svn trunk. There is post here which might help you.

Community
  • 1
  • 1
lucas clemente
  • 6,255
  • 8
  • 41
  • 61
1

You can also build and run later versions of clang within Xcode. See for example:

http://shapeof.com/archives/2010/01/using_the_latest_llvm_with_xcode.html

Jean-Denis Muys
  • 6,772
  • 7
  • 45
  • 71
  • thnx jean-denis. have you tried this yourself? any thing sto look out for? – mt3 Feb 03 '11 at 08:52
  • no I haven't yet done it. It's in my plans for the near future. But it definitely is something that can be done without too many problems. The idea is to think of that as a two-step problem, each being independent. 1- Have clang 2.0 run under Mac OS X (outside Xcode). See http://llvm.org for that. 2- Have Xcode call on "3rd party" external compiler. This has been done before, for example by The Cocotron project (http://cocotron.org). I did the Cocotron thing. It works fine. – Jean-Denis Muys Feb 03 '11 at 18:13
1

In case anyone is looking at this much later, here is the canonical page for C++0x in Clang. http://clang.llvm.org/cxx_status.html

Andy Dent
  • 17,578
  • 6
  • 88
  • 115