GCC 4.7 / 4.8 as Xcode C / C ++ Compiler

Now I am working on a C ++ project with which I want to use C ++ 11. In this project I use the NTL library , which is used for number theory. Because of the comfort, the car completes Xcode, I write my code with Xcode, and the NTL library is statically linked to the -lntl flag.

Now I want to use some of the features of C ++ 11. The Apple LLVM compiler, which is used by default in Xcode, includes such support, but some compilation with NTL and iostream does not work, unlike the LLVM GCC 4.2 compiler with Xcode.

So, I use the GCC 4.2 LLVM compiler, but it does not include C ++ 11 support. So I brew 'd gcc48, and now I want to make Xcode compile its code with gcc4.8.

How can i do this?

- EDIT -
Solved thanks to all the comments that suggested switching from lib ++ to stdlib ++ (GNU lib ++) and solving the NTL problem not compiled with Clang.

+5
source share
1 answer

There are two different versions of the C ++ runtime library: gcc libstdc++and clang libc++, which are incompatible with each other.

Change usage from libc++to libstdc++.

+1
source

All Articles