Setting GCC 4.2 as the default compiler on Mac OS X Leopard

前端 未结 6 1700
小蘑菇
小蘑菇 2020-11-29 18:53

I\'m sure there must be a way to do this. As you are probably aware the latest versions of Xcode (and in fact I think all versions of Xcode) on Leopard come with GCC 4.0.1 a

6条回答
  •  暖寄归人
    2020-11-29 19:36

    Command line usage for all configure scripts:

      cd /usr/bin
      rm cc gcc c++ g++
      ln -s gcc-4.2 cc
      ln -s gcc-4.2 gcc
      ln -s c++-4.2 c++
      ln -s g++-4.2 g++
    

    Make a record of the current link targets, so you can restore them if you want to.

    If you don't want to change the system wide settings, add a directory into PATH before /usr/bin (say, $HOME/bin), and make the symlinks there

    I haven't tested whether this affects Xcode projects, since I don't use Xcode (only command line).

提交回复
热议问题