Adding gcc 4.9 as a compiler option in Xcode

Posted by user2129150 on Super User See other posts from Super User or by user2129150
Published on 2013-06-25T21:38:54Z Indexed on 2013/06/25 22:23 UTC
Read the original article Hit count: 312

Filed under:
|

I asked this question on StackOverflow, but it's pretty much stagnant. Sorry if this is considered a repost/double-post.

I just installed gcc 4.9 (with C11 support), and want to add it to Xcode 4.6.3's build options as a compiler option. I ran make and make install, and the packages are all there (under /usr/bin/gcc. Running gcc --version confirms that gcc 4.9 is installed rather than an older version.

When I go into an existing Xcode project's build settings, the only compiler options available are

  • Apple LLVM compiler 4.2

  • LLVM GCC 4.2

  • Other...

Clearly, GCC 4.9 would have to be added using the "Other..." option, although I'm not sure how. I've tried inputting the path to gcc (/usr/bin/gcc), although the default value for other isn't a path at all: com.apple.compilers.llvmgcc42.

I've also tried following the instructions from the answer to this question as well, but the machine I'm on doesn't have the /Developer directory at all, since I believe Apple integrated the developer tools that required (and created) this directory into Xcode.

How do I add gcc 4.9 as a compiler option in Xcode?

© Super User or respective owner

Related posts about xcode

Related posts about gcc