已安装gcc编译器,但./configure还是提示找不到编译器(分析)
1、编译nginx前, ./configure检查提示找不到C编译器
[root@test nginx-1.12.]# ./configure
checking for OS
+ Linux 3.10.-.el7.x86_64 x86_64
checking for C compiler ... not found
2、重装gcc编译器后,还是提示找不到C编译器
[root@test nginx-1.12.]# yum -y reinstall gcc gcc-c++ autoconf automake make
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors..com
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch :2.69-.el7 will be reinstalled
---> Package automake.noarch :1.13.-.el7 will be reinstalled
---> Package gcc.x86_64 :4.8.-.el7_6. will be reinstalled
---> Package gcc-c++.x86_64 :4.8.-.el7_6. will be reinstalled
---> Package make.x86_64 :3.82-.el7 will be reinstalled
--> Finished Dependency Resolution
Installed:
autoconf.noarch :2.69-.el7 automake.noarch :1.13.-.el7 gcc.x86_64 :4.8.-.el7_6.
gcc-c++.x86_64 :4.8.-.el7_6. make.x86_64 :3.82-.el7 Complete!
[root@test nginx-1.12.]# ./configure
checking for OS
+ Linux 3.10.-.el7.x86_64 x86_64
checking for C compiler ... not found
3、网上找一个hello world C程序代码,尝试编译,提示 cannot find 'ld'
[root@test ~]# vim hello_world.c
---------------------------------------
#include <stdio.h>
void main()
{
printf("Hello World \n");
}
---------------------------------------
[root@test ~]# gcc hello_world.c
collect2: fatal error: cannot find 'ld'
compilation terminated.
4、到另一台可正常编译电脑,查找ld位置
[root@xdc tmp]# which ld
/usr/bin/ld
5、回到问题机器,发现/usr/bin/ld有这个文件,但是which ld,找不到该文件
[root@test]# ll /usr/bin/ld
lrwxrwxrwx. root root May : /usr/bin/ld -> /etc/alternatives/ld
[root@test nginx-1.12.]# which ld
/usr/bin/which: no ld in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
6、ll /usr/bin/ld 发现该文件最终链接到/usr/bin/ld.bfd,但是,最终的源文件没有可执行权限
[root@test nginx-1.12.]# ll /usr/bin/ld
lrwxrwxrwx. root root May : /usr/bin/ld -> /etc/alternatives/ld
[root@test nginx-1.12.]# ll /etc/alternatives/ld
lrwxrwxrwx. root root May : /etc/alternatives/ld -> /usr/bin/ld.bfd
[root@test nginx-1.12.]# ll /usr/bin/ld.bfd
-rw-rw-rw-. root root Oct /usr/bin/ld.bfd
7、给/usr/bin/ld.bfd文件添加执行权限,编译helloworld成功,./configure 通过gcc环境检查
[root@test ~]# chmod +x /usr/bin/ld.bfd //添加执行权限
[root@test ~]# which ld
/usr/bin/ld
[root@test ~]# gcc hello_world.c //编译成功
[root@test ~]# ./
a.out create.sh nginx-1.12./ .pki/ .ssh/
[root@test ~]# ./a.out
Hello World
[root@test ~]# cd nginx-1.12./
[root@test nginx-1.12.]# ./configure
checking for OS
+ Linux 3.10.-.el7.x86_64 x86_64
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 4.8. (Red Hat 4.8.-) (GCC)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
8、如果gcc编译时,提示找不到下面其中一个或多个文件,也可通过 yum -y reinstall binutils 重新安装工具集
GNU Binutils
The GNU Binutils are a collection of binary tools. The main ones are:
- ld - the GNU linker.
- as - the GNU assembler.
But they also include:
- addr2line - Converts addresses into filenames and line numbers.
- ar - A utility for creating, modifying and extracting from archives.
- c++filt - Filter to demangle encoded C++ symbols.
- dlltool - Creates files for building and using DLLs.
- gold - A new, faster, ELF only linker, still in beta test.
- gprof - Displays profiling information.
- nlmconv - Converts object code into an NLM.
- nm - Lists symbols from object files.
- objcopy - Copies and translates object files.
- objdump - Displays information from object files.
- ranlib - Generates an index to the contents of an archive.
- readelf - Displays information from any ELF format object file.
- size - Lists the section sizes of an object or archive file.
- strings - Lists printable strings from files.
- strip - Discards symbols.
- windmc - A Windows compatible message compiler.
- windres - A compiler for Windows resource files.
已安装gcc编译器,但./configure还是提示找不到编译器(分析)的更多相关文章
- Debian/Ubuntu 已安装gcc/g++ 4.8.1
gcc 4.8.1 是第一个全然支持C++11(C++14非常可能在gcc 4.9.0開始支持.)的编译器,Windows上能够安装mingw版的.在sourceforge 上有下载.安装也比較方便. ...
- linux查看是否已安装GCC及安装GCC
输入:gcc -v;如果提示未找到命令即表示没有安装 使用:yum install gcc即可
- 安装了包,pycharm却提示找不到包
这段时间,我爬虫爬到了一个论坛的数据,有个分析需要知道他的字符编码,因此使用到了 chardet,我在终端很顺利的安装了这个,但是在pycharm里使用的时候老是提示有错误,向下面这样: 其实这个是因 ...
- VMwareTools安装失败提示找不到C headers和gcc目录
在VMware虚拟机上安装好linux系统后,发现往往不能全屏,也不能设置共享文件夹进行文件共享,这时候可以通过安装VMwareTools这个工具来实现文件拖拽.共享和全屏. 安装的过程不再赘述,关键 ...
- 编译安装pgbouncer-checking for OpenSSL... configure: error: not found
花了一上午时间将pgbouncer的参数通读了一遍,对他有个大致的了解:1.配置分为连接池和pgbouncer两个部分[database]\[pgbouncer ].2.一条记录对应创建一个连接池,连 ...
- 【转载·】Linux yum 安装 gcc 、gcc-c++
2017年09月29日 22:45:54 上善若水 阅读数:6653更多 个人分类: Linux学习 所属专栏: Linux学习杂技 版权声明:本文为博主原创文章,未经博主允许不得转载. ht ...
- Linux安装gcc编译器详解
本人使用的是CentOS 6.5 64位系统,由于在安装系统的时候并没有勾选安装gcc编译器,因此需要自行安装gcc编译器. 使用yum安装gcc 对于配备了yum的Linux发行版而言,安装gcc编 ...
- Linux下安装gcc 、g++ 、gfortran编译器
一.ubuntu下gcc/g++/gfortran的安装 1.安装 (1).gcc ubuntu下自带gcc编译器.可以通过“gcc -v”命令来查看是否安装. (2).g++ 安装g++编译器,可以 ...
- 子进程 已安装 post-installation 脚本 返回错误状态 1,dpkg: 处理软件包 python-crypto (--configure)时出错: 该软件包正处于非常不稳定的状态;
这几天在学习redis的时候,装软件总是报错,两个问题都和dpkg有关,上网查阅了些解决办法,发现整体来说执行以下方法均可解决. 虽然每个人需要安装的包不同,但是出现此类问题的不同也只有安装包的名字, ...
随机推荐
- Windows下编译 Hadoop
Windows下编译 Hadoop-2.9.2 系统环境 系统: Windows 10 10.0_x64 maven: Apache Maven 3.6.0 jdk: jdk_1.8.0_201 Pr ...
- 【转载】为什么我的网站加www是打不开的呢
在访问网站的过程中,我们发现有些网站访问不带www的主域名可以正常访问,反而访问加www的域名打不开,那为什么有的网站加www是打不开的呢?此情况很大可能是因为没有解析带www的域名记录或者主机Web ...
- jquery-weui滚动事件的注册与注销
注册infinite(50)是自定义的,详细暂时没去了解,可以不写即代表默认值. // body是整一块代码的标签,也就是滚动的部分. $('body').infinite().on("in ...
- 对于Linux中文件描述符的疑问以及解决
问题 每次web服务器或者是几乎所有Linux服务器都需要对文件描述符进行调整,我使用ulimit -n来查看当前用户的最多能打开的文件,默认设置的是1024个,但是系统运行起来以及开启一些简单的 ...
- springboot系列(八)springboot整合mybatis
本篇介绍一下在springboot中整合mybatis ,使用mysql数据库,集成durid 连接池技术,全部代码是手动生成,没有使用代码生成器来构建代码. 一.创建数据库和表 二.在pom中添加依 ...
- 【华为云】MRS journey node HDFS 不一致
HDFS JournalNode数据不同步告警 恢复指导 1 停止有问题的 JN 实例 2 清楚无效数据 登录有问题JN的后台,使用omm用户操作以下命令: cd /srv/BigData/journ ...
- 二进制部署kubernetes集群(上篇)
1.实验架构 1.1.硬件环境 准备5台2c/2g/50g虚拟机,使用10.4.7.0/24 网络 .//因后期要直接向k8s交付java服务,因此运算节点需要4c8g.不交付服务,全部2c2g足够. ...
- ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded
操作系统:Ubuntu 18.04 LTS 数据库:MySQL 5.7 执行了一次修改root用户密码的操作,修改完后退出了数据库,但是,当我在命令行中登录数据库(mysql -u root -p), ...
- Loadrunner 计算保留两位小数不四舍五入
有时候在测试过程中会截取返回值,当你截取的值不是最终的值,需要进行计算后才能使用并且需要保留两位小数,不进行四舍五入的计算: 此时 我使用了各种办法,但是最终我采用了一种最直接,最暴力的方法就是先乘后 ...
- linux网络编程之socket编程(十一)
今天继续学习socket编程,这次主要是学习超时方法的封装,内容如下: ①.alarm[不常用,了解既可] 它的实现思路是这样的: 但是这种方案有一定的问题,因为闹钟可能会作为其它的用途,这时所设置的 ...