我是Linux新手,而且我很难尝试完成这项工作。 我卸载并安装了gcc几次。现在,当我运行gcc --version时,它仍然表示zsh: command not found。已安装GCC,但找不到命令

当我去/usr/local/bin和运行ls -l我找到GCC的多个版本

lrwxr-xr-x 1 ps032791 admin 33 Jul 2 2014 c++-4.6 -> ../Cellar/gcc46/4.6.4/bin/c++-4.6

lrwxr-xr-x 1 ps032791 admin 33 Apr 6 11:58 c++-4.7 -> ../Cellar/gcc47/4.7.3/bin/c++-4.7

lrwxr-xr-x 1 ps032791 admin 33 Apr 6 15:27 c++-4.8 -> ../Cellar/gcc/4.8.3_1/bin/c++-4.8

lrwxr-xr-x 1 ps032791 admin 32 Apr 6 15:19 cloog -> ../Cellar/cloog/0.18.1/bin/cloog

lrwxr-xr-x 1 ps032791 admin 33 Jul 2 2014 cpp-4.6 -> ../Cellar/gcc46/4.6.4/bin/cpp-4.6

lrwxr-xr-x 1 ps032791 admin 33 Apr 6 11:58 cpp-4.7 -> ../Cellar/gcc47/4.7.3/bin/cpp-4.7

lrwxr-xr-x 1 ps032791 admin 33 Apr 6 15:27 cpp-4.8 -> ../Cellar/gcc/4.8.3_1/bin/cpp-4.8

lrwxr-xr-x 1 ps032791 admin 28 May 29 2014 erb -> ../Cellar/ruby/2.1.2/bin/erb

lrwxr-xr-x 1 ps032791 admin 33 Jul 2 2014 g++-4.6 -> ../Cellar/gcc46/4.6.4/bin/g++-4.6

lrwxr-xr-x 1 ps032791 admin 33 Apr 6 11:58 g++-4.7 -> ../Cellar/gcc47/4.7.3/bin/g++-4.7

lrwxr-xr-x 1 ps032791 admin 33 Apr 6 15:27 g++-4.8 -> ../Cellar/gcc/4.8.3_1/bin/g++-4.8

-rw-r--r-- 1 ps032791 admin 0 Apr 6 13:23 gcc-4.2

lrwxr-xr-x 1 ps032791 admin 33 Jul 2 2014 gcc-4.6 -> ../Cellar/gcc46/4.6.4/bin/gcc-4.6

lrwxr-xr-x 1 ps032791 admin 33 Apr 6 11:58 gcc-4.7 -> ../Cellar/gcc47/4.7.3/bin/gcc-4.7

lrwxr-xr-x 1 ps032791 admin 33 Apr 6 15:27 gcc-4.8 -> ../Cellar/gcc/4.8.3_1/bin/gcc-4.8

lrwxr-xr-x 1 ps032791 admin 36 Apr 6 11:58 gcc-ar-4.7 -> ../Cellar/gcc47/4.7.3/bin/gcc-ar-4.7

lrwxr-xr-x 1 ps032791 admin 36 Apr 6 15:27 gcc-ar-4.8 -> ../Cellar/gcc/4.8.3_1/bin/gcc-ar-4.8

lrwxr-xr-x 1 ps032791 admin 36 Apr 6 11:58 gcc-nm-4.7 -> ../Cellar/gcc47/4.7.3/bin/gcc-nm-4.7

lrwxr-xr-x 1 ps032791 admin 36 Apr 6 15:27 gcc-nm-4.8 -> ../Cellar/gcc/4.8.3_1/bin/gcc-nm-4.8

lrwxr-xr-x 1 ps032791 admin 40 Apr 6 11:58 gcc-ranlib-4.7 -> ../Cellar/gcc47/4.7.3/bin/gcc-ranlib-4.7

lrwxr-xr-x 1 ps032791 admin 40 Apr 6 15:27 gcc-ranlib-4.8 -> ../Cellar/gcc/4.8.3_1/bin/gcc-ranlib-4.8

我跑'酿造医生,我得到下面的输出,

Warning: You have MacPorts or Fink installed:

/opt/local/bin/port

This can cause trouble. You don't have to uninstall them, but you may want to

temporarily move them out of the way, e.g.

sudo mv /opt/local ~/macports

Warning: Your Homebrew is outdated.

You haven't updated for at least 24 hours, this is a long time in brewland!

To update Homebrew, run `brew update`.

Warning: You have unlinked kegs in your Cellar

Leaving kegs unlinked can lead to build-trouble and cause brews that depend on

those kegs to fail to run properly once built. Run `brew link` on these:

gcc48

Warning: You have uncommitted modifications to Homebrew

If this a surprise to you, then you should stash these modifications.

Stashing returns Homebrew to a pristine state but can be undone

should you later need to do so for some reason.

cd /usr/local/Library && git stash && git clean -d -f

Warning: /usr/bin occurs before /usr/local/bin

This means that system-provided programs will be used instead of those

provided by Homebrew. The following tools exist at both paths:

erb

gem

git

git-cvsserver

git-receive-pack

git-shell

git-upload-archive

git-upload-pack

irb

rake

rdoc

ri

ruby

testrb

Consider setting your PATH so that /usr/local/bin

occurs before /usr/bin. Here is a one-liner:

echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

我试图运行echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile ,重新启动终端,并再次运行brew doctor,它仍抱怨同样的事情。我完全迷失在这里。有人可以用这个指导我吗?我究竟做错了什么?提前致谢。

+0

你使用'zsh',但修改'.bash_profile'。这可能不适合 –

+0

你可能安装了gcc,但你没有一个名为'gcc'的符号链接指向其中一个执行。选择你想要的gcc版本,并建立一个符号链接。例如'ln/usr/bin/gcc/path/to/cellar/gcc-4.8/gcc' –

+0

我跑了,'ln/usr/bin/gcc /usr/local/Cellar/gcc/4.8.3_1/bin/gcc- 4.8'并且它说'ln:/ usr/bin/gcc:没有这样的文件或目录'。我遍历到'/ usr/bin',并且我无法找到gcc –

gcc找不到Linux/in,已安装GCC,但找不到命令相关推荐

  1. linux 为什么要安装gcc和gcc-c++(又叫做g++)

    linux 为什么要安装gcc和gcc-c++(又叫做g++) gcc-c++(又叫做g++)是为gcc提供c++语言特性支持的 linux上的gcc是Gnu的C语言编译器,至于C++编译器,它的名字 ...

  2. linux 查看go安装目录,终于找全了!Go的三种常见的安装方式,各种系统多个版本应有尽有...

    原标题:终于找全了!Go的三种常见的安装方式,各种系统多个版本应有尽有 Go有多种安装方式,你可以选择自己喜欢的.这里我们介绍三种最常见的安装方式: Go源码安装:这是一种标准的软件安装方式.对于经常 ...

  3. Linux 环境下安装 gcc 详细过程 以及安装 glibc

    1.了解一下 gcc 目前,GCC可以用来编译C / C++.FORTRAN.Java.OBJC.ADA等语言的程序,可根据需要选择安装支持的语言. 在安装之前,系统必须有 cc 或者 gcc 的编译 ...

  4. Red Hat Enterprise Linux 5.4安装GCC

    注意: 如果打算使用GUI的方式安装,需要导入GPG-Key (否则在使用GUI时会出现public key for *.rpm is not installed) 1.请切换到安装光盘目录下: # ...

  5. linux怎么离线安装gcc文件夹,CentOS下离线安装gcc环境,图文详细,方法全面

    CentOS下离线安装gcc环境,图文详细,方法全面 下载 方式1:如果有网的虚拟机还没有安装,可以直接 yum install --downloadonly --downloaddir=/root/ ...

  6. linux下编译安装gcc,Linux编译安装GCC 5.1.0

    Linux下编写C/C++程序自然缺不了一个优秀的编译器,Linux下比较常见的自然是GCC了.2015年4月下旬GCC也出到了5.1.0版本,对于C++11/14也有了更好的支持了.因为最近在学习O ...

  7. linux怎么在线安装gcc,Linux 在线安装软件 gcc在线安装的操作方法

    Linux在线安装相关命令: yum install:全部安装 yum install :安装指定的程序包 yum groupinsall :安装程序组 yum -y update:升级所有包,改变软 ...

  8. 【linux】RedHat 安装 gcc、g++

    环境介绍 系统版本:RedHat 7.6 cat /etc/redhat-release # Red Hat Enterprise Linux Server release 7.6 (Maipo) 安 ...

  9. linux 查看已安装软件

    接触新的环境新的项目需要先了解当前环境下安装了哪些东西 一.查看系统配置文件(检查已安装的软件) 一些核心软件需要配置环境变量, less /etc/profile 查看(按G查看文件末尾的expor ...

最新文章

  1. Java项目:网上商城系统(java+jsp+servlert+mysql+ajax)
  2. DataGrid分页使用小结
  3. 在Apache上隐藏服务器签名的方法
  4. Python 中实用却不常见的小技巧!
  5. 重写(override / overwrite)
  6. 用eslint + prettier + pre-commit管理项目(React)
  7. php打出等边三角形,CSS 如何进行单一div的正多边形变换
  8. linux常用关机命令,linux下常用关机命令
  9. VS/C#添加chart控件
  10. 语音搜索的基础-语音识别
  11. 【云原生之Docker实战】使用Docker部署OpenKM文档管理系统
  12. php fpm listen.owner,php-fpm配置详解
  13. android 18x games,Roadgames
  14. 小程序关注微信公众号的方法
  15. 【今日CV 计算机视觉论文速览 第132期】Tue, 18 Jun 2019
  16. 图文详解 DFS 算法 和 BFS 算法
  17. 主机防病毒攻略之勒索病毒
  18. 来美国一年半了,命里有时终须有,命里无时莫强求(2)
  19. 后疫情时代,打造15分钟交通圈
  20. ACW830. 单调栈

热门文章

  1. 使用Python进行名片OCR(识别姓名,职务,电话,Email邮箱)
  2. python学习总结——列表
  3. 数字地和模拟地的区别
  4. 【原创】线性代数学习笔记——剑桥食谱
  5. 数据库服务器账号不能登录问题
  6. nodejs微信小程序 vue网络在线考试系统
  7. 神经网络的学习(训练):损失函数(均方误差、交叉熵误差)
  8. mysql 8免安装图解_mysql 8.0.21免安装版配置方法图文教程
  9. 身份证实名认证接口是什么?
  10. 拓嘉辰丰:拼多多网店如何使用网店物流提醒短信?