vendredi 25 décembre 2015

Can I have gcc/c++ on MacOS X 10.11 pointing to the ACTUAL gcc/g++?

This is really annoying. For some reason, on MacOS X 10.11 (probably also on previous versions) there are gcc and g++ commands (in /usr/bin, they are not aliases or so) which, when executed with the -v argument, give:

Configured with: --prefix=/Applications/http://ift.tt/1d5DwEL --with-gxx-include-dir=/Applications/http://ift.tt/1KvS6BZ
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix

So it looks like they actually execute the clang and clang++ compilers by apple. Now, I really need my computer to execute gcc and g++ when I invoke those commands, both from the terminal and through makefiles.

The reasons for this are two:

  1. I like to have my computer do what I ask it to do.
  2. Apparently clang++ compiles stuff using a different c++ standard library from g++, and this is causing me problems when I compile and link my stuff with g++-5 (the ACTUAL g++, installed via homebrew) against CppUnit.

Does anybody know what is the best way to have gcc and g++ actually call gcc and g++?

Aucun commentaire:

Enregistrer un commentaire