mac os 环境变量设置
上周,当我尝试在我的 macbook 上安装 gcc_select 时,我执行了几个命令,我确实记得我只是 cd 到某个目录并使用 root 进行了一些修改。一切看起来都很好,但是,我发现当我打开终端并尝试使用 gcc 或 g++ 编译程序时,它一直说“找不到命令”。我必须手动输入 :" export PATH=$ PATH:/Developer/usr/bin”,以便运行 gcc 或 g++ 命令。
我的问题是,有谁请告诉我如何永久更改它,这样我就不需要一次又一次地输入相同的命令。
Last week, when I am trying to install gcc_select on my macbook, I went through several commands,I did remember I just cd to a certain directory and made some modifications using the root. Everything seems fine, however, I found that when I open the terminal and trying to compile a program by using gcc or g++, it keeps saying that the "command not found".I have to manually to type the :" export PATH=$PATH:/Developer/usr/bin" in order to make the gcc or g++ command run.
My question is , is there anyone please tell me how to permanently change that, so that I don't need to type the same command again and again.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
附加到
主目录中的 .profile 文件中。如果不存在,则创建它。更好的方法是 user57368 在评论中给出的方法。
Append
in the .profile file in your home directory. If it does not exit, create it. Better way would be the one user57368 gave in the comment though.