XCode 4 - using GCC 4.0 to compile? - xcode

Code coverage for xcode 4 only works on GCC 4.0.
How can I set my compiler to use GCC 4.0 instead of GCC 4.2.
Do i need to download 4.0 ?

GCC 4.0 is not installed with Xcode 4. You can get it back by following the directions in this question about adding support for 10.4 and 10.5 SDKs to Xcode 4.

Related

How do I change compiler on Xcode to gcc 7.3.0?

I currently have Xcode 6.2.
First is there a way to check if this version of Xcode comes with gcc 7.3.0? And if it does have gcc 7.3.0, how do I set up Xcode so that gcc 7.3.0 becomes the default compiler?
However if my Xcode does not have gcc 7.3.0 how do I get gcc 7.3 and set up Xcode so that gcc 7.3.0 becomes the default compiler?
Xcode uses the LLVM Clang compiler, not gcc. gcc can be installed, the easiest way would be using either Homebrew or MacPorts. I'm not sure if there's any way to make it the default compiler though, especially not to use from inside Xcode. Is there some specific feature/reason why you need gcc 7.3?

Whats is proper version of llvm/clang/xcode?

This gist mentions that xcode 9 published with 'Apple LLVM version 9.0.0 (clang-900.0.38)', but the last version of llvm in llvm.org is LLVM 5.0.0.
What is the relation between them?
Apple's Xcode ship with LLVM, but it is not the open source version. For example, some clang extra tool won't be installed to you Mac. So at least, Apple has modify CMakeLists.txt. You can read the CMakeLists.txt or Makefile in apple open source.
This is only a suggestion, maybe is not helpful.
Another: index.file shows Xcode LLVM 9 map to Clang/LLVM 4.0.
You can obtain the source code for the compiler shipped with Xcode from https://opensource.apple.com if you want to have the exact same version of LLVM.

What compilers are included in Xcode Command Line tools?

Is there a way to check this? I know llvm is one of the compilers in Xcode, I think GCC also?? Is this correct? is there a definitive way to know?
From the Xcode 4 Release Notes:
DEPRECATED: LLVM-GCC compiler and GDB debugger.
Xcode 4.6 is the last release to include the LLVM-GCC compiler and the GDB debugger.
And
GCC 4.0 has been removed from Xcode 4. If your project has an explicit
Compiler Version of gcc 4.0, you need to change it in order to build
with Xcode 4.
Xcode 5 comes "only" with the LLVM compiler suite, including "clang" and "clang++".

Installing Clang on Mac

This is the first time I am working on Mac and I wanted to install the latest version of Clang, so I installed Xcode 5 and Xcode command line tools.
But the Clang version I got from the Xcode (in the terminal, I typed clang --version). It gives me following output:
clang++ --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
I am confused what Clang version it is. I read that the latest Clang is version 3.5. Is the one above similar? (I need complete support for C++11). What is the difference?
Apple uses its own version numbers for Clang and LLVM which correspond with the Xcode version they are bundled with.
The actual Clang version is in indicated by the (based on LLVM X.Xsvn) part. So you have version 3.3, which is the most recent official release as you can see from the LLVM website. That version implements all the major C++11 features as you can see from the C++ support status page.

Error when building Qt 4.8 (beta) with gcc 4.6.1 on MacOSX Lion

I try to build the latest source of the Qt 4.8 beta with gcc 4.6.1 configure fails with the following:
cc1plus: error: unrecognized command line option ‘-fconstant-cfstrings’
It seems to be working with the g++ version (i686-apple-darwin11-llvm-g++-4.2) shipped with XCode 4.1
The reason for this combo of gcc and qt is that i want to try out the new C++11 features available in the latest version of Qt.
I have a same problem but with gcc 4.8.1
but i manually erase it in root project dir configure file and corelib/configure[released|debug]
for now i cant find where is generated.

Resources