3

I have recently switched from Windows to Mac . I was told that Xcode has the C/C++ libraries(GCC) included. Apparently, the new Xcode 5 doesn't have them. As IDE, I have CodeBlocks downloaded. How do I install the libraries for CodeBlocks in Mac?

saruftw
  • 1,104
  • 2
  • 14
  • 37
  • You might consider asking on http://apple.stackexchange.com/. Independently of that, you should find the related questions about installing the command line tools from XCode. That changed recently, so I've forgotten the answer, but I know it's around here somewhere. For example, a search on SO with 'xcode command line' reveals [XCode 4.4 and later install command line tools](http://stackoverflow.com/questions/9329243/xcode-4-4-and-later-install-command-line-tools) – Jonathan Leffler Jun 15 '14 at 13:48
  • Btw: Xcode5 can hardly be described as new anymore - Xcode6 is now available. – marko Jun 15 '14 at 13:56
  • You can install the libraries from Xcode, under the option "install command line tools". If you specifically want gcc instead of clang, you can install it using macports or homebrew. – toasted_flakes Jun 15 '14 at 13:58
  • @marko calling developer preview software `available` isn't completely accurate. – Grady Player Jun 15 '14 at 14:08
  • where are you getting hung up, what do you mean "libraries for CodeBlocks in Mac"? it is in the compilation phase, you can't link to the libraries, or your compiler can't find the headers? or you can't build CodeBlocks? – Grady Player Jun 15 '14 at 14:15

1 Answers1

1

Apple deprecated gcc in XCode5 (after giving warning for quite a few releases). The main reason for this was that clang is now the system compiler, along with libc++, its accompanying standard library. One of the motivations for the move to clang is that the IDE makes heavy use of the compiler's modular architecture for code syntax highlighting, indexing and refactoring.

I can't imagine many reasons why you actually would specifically need GCC if building software on MacOSX and iOS. Clang has had the edge of GCC in both compilation speed and standards compliance for some time.

What you may need to do, if you haven't already, is install the optional XCode5 command-line tools package (the UI for this changed a few versions ago - google for the solution to your version of XCode5). This installs clang and other command-line tools (or more likely symlinks to them) in /usr, which where external tools and build and configuration tools such as cmake and autoconf expect them to be. clang is also aliased to cc.

marko
  • 9,029
  • 4
  • 30
  • 46
  • Yes, Clang is better but I just prefer GCC for no reason. Anyways I found this GCC auto installer on Github that helped me. Thanks for the info. – saruftw Jun 15 '14 at 18:34