将 GCC 4.2 设置为 Mac OS X Leopard 上的默认编译器 [英] Setting GCC 4.2 as the default compiler on Mac OS X Leopard

查看:23
本文介绍了将 GCC 4.2 设置为 Mac OS X Leopard 上的默认编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信一定有办法做到这一点.正如您可能知道 Leopard 上最新版本的 Xcode(实际上我认为 Xcode 的所有版本)都带有 GCC 4.0.1 和 GCC 4.2.GCC 4.0.1 是默认的系统编译器,而 GCC 4.2 是一个可选的编译器,您可以在 Xcode 项目设置中进行设置.

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 and GCC 4.2. GCC 4.0.1 is the default system compiler while GCC 4.2 is an optional compiler you can set in the Xcode project settings.

有谁知道如何将 GCC 4.2 设置为所有选项的默认编译器?无论我在 Xcode 中做什么,命令行使用和配置脚本仍然使用 GCC 4.0.1 而不是 GCC 4.2.我假设这只是更改路径变量或其他变量的一种情况,但我对此很困惑.

Does anyone know how to set GCC 4.2 as the default compiler for all options? Preferably command line use as well as configure scripts still use GCC 4.0.1 rather than GCC 4.2 no matter what I do in Xcode. I'm assuming it is simply a case of changing a path variable or some such but I am stumped on this one.

感谢任何帮助.谢谢.

推荐答案

所有配置脚本的命令行用法:

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.

如果您不想更改系统范围的设置,请在/usr/bin 之前的 PATH 中添加一个目录(例如,$HOME/bin),并在那里制作符号链接

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

我没有测试这是否会影响 Xcode 项目,因为我不使用 Xcode(仅命令行).

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

这篇关于将 GCC 4.2 设置为 Mac OS X Leopard 上的默认编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆