Domanda

In OS X, how can I link gcc-4.8 from homebrew to gcc? I already tried to link gcc-4.8 to /usr/local/bin/gcc but this does not work. I really need this because I have shared makefiles in a course at the university.

È stato utile?

Soluzione

There are at least a couple of options.

  1. I have my GCC 4.8.2 installed under /usr/gcc/v4.8.2 and I ensure that /usr/gcc/v4.8.2/bin is on my PATH ahead of /usr/bin. That way, the undecorated name gcc means GCC 4.8.2. (This is on Mac OS X 10.9.1 Mavericks, just for the record.)
  2. Specify CC=/usr/gcc/v4.8.2/bin/gcc on command lines, etc. Painful, so I don't regard it as a real option.
  3. Make /usr/bin/gcc point to /usr/gcc/v4.8.2/bin/gcc instead of being an executable that runs clang.

I distrust modifying /usr/bin or /bin (or /sbin or /usr/sbin). I seldom use the system-provided Perl, for example, but always use my own build, using the same general technique.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top