gcc: error trying to exec 'cc1': execvp: No such file or directory解决方法

安装gcc之后出现了执行.c文件时出现错误 添加环境变量之后即可 whereis cc1 找到cc1在哪里 /usr/libexec/gcc/x86_64-redhat-linux/4.8.2/cc1 我的centos7中cc1的位置【我的/usr/libexe...

安装gcc之后出现了执行.c文件时出现错误


添加环境变量之后即可

whereis cc1

找到cc1在哪里


/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/cc1

我的centos7中cc1的位置【我的/usr/libexec/gcc/x86_64-redhat-linux/4.8.2 目录下没有 cc1 命令,从其它机器copy一个过来,然后就可以了】

如果找不到 用


locate cc1

找出后,复制


/usr/libexec/gcc/x86_64-redhat-linux/4.8.2

然后


PATH="$PATH":/usr/libexec/gcc/x86_64-redhat-linux/4.8.2

 导入环境变量


export PATH

到此就可以了

  • 发表于 2024-07-05 17:36
  • 阅读 ( 27 )

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
shitian
shitian

662 篇文章

作家榜 »

  1. shitian 662 文章
  2. 石天 437 文章
  3. 每天惠23 33 文章
  4. 小A 29 文章