CentOSコンパイルの問題:./ configure

エラーを報告する

[root@localhost inotify-tools-3.14]#./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/opt/inotify-tools-3.14':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

理由:マウントされていません

ここに画像の説明を挿入します

解決策:ミラーを取り付けます

[root@localhost inotify-tools-3.14]#mount /dev/cdrom /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载

エラーを報告する

[root@localhost inotify-tools-3.14]#./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/opt/inotify-tools-3.14':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

理由:環境問題

解決策:gcc、gcc-c ++をインストールします

[root@localhost inotify-tools-3.14]#yum -y install gcc gcc-c++
已加载插件:fastestmirror, langpacks
local                                                              | 3.6 kB  00:00:00     
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 gcc.x86_64.0.4.8.5-16.el7 将被 安装
--> 正在处理依赖关系 cpp = 4.8.5-16.el7,它被软件包 gcc-4.8.5-16.el7.x86_64 需要
--> 正在处理依赖关系 glibc-devel >= 2.2.90-12,它被软件包 gcc-4.8.5-16.el7.x86_64 需要
--> 正在处理依赖关系 libmpc.so.3()(64bit),它被软件包 gcc-4.8.5-16.el7.x86_64 需要
---> 软件包 gcc-c++.x86_64.0.4.8.5-16.el7 将被 安装
--> 正在处理依赖关系 libstdc++-devel = 4.8.5-16.el7,它被软件包 gcc-c++-4.8.5-16.el7.x86_64 需要
--> 正在检查事务
---> 软件包 cpp.x86_64.0.4.8.5-16.el7 将被 安装
---> 软件包 glibc-devel.x86_64.0.2.17-196.el7 将被 安装
--> 正在处理依赖关系 glibc-headers = 2.17-196.el7,它被软件包 glibc-devel-2.17-196.el7.x86_64 需要
--> 正在处理依赖关系 glibc-headers,它被软件包 glibc-devel-2.17-196.el7.x86_64 需要
---> 软件包 libmpc.x86_64.0.1.0.1-3.el7 将被 安装
---> 软件包 libstdc++-devel.x86_64.0.4.8.5-16.el7 将被 安装
--> 正在检查事务
---> 软件包 glibc-headers.x86_64.0.2.17-196.el7 将被 安装
--> 正在处理依赖关系 kernel-headers >= 2.2.1,它被软件包 glibc-headers-2.17-196.el7.x86_64 需要
--> 正在处理依赖关系 kernel-headers,它被软件包 glibc-headers-2.17-196.el7.x86_64 需要
--> 正在检查事务
---> 软件包 kernel-headers.x86_64.0.3.10.0-693.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

==========================================================================================
 Package                  架构            版本                       源              大小
==========================================================================================
正在安装:
 gcc                      x86_64          4.8.5-16.el7               local           16 M
 gcc-c++                  x86_64          4.8.5-16.el7               local          7.2 M
为依赖而安装:
 cpp                      x86_64          4.8.5-16.el7               local          5.9 M
 glibc-devel              x86_64          2.17-196.el7               local          1.1 M
 glibc-headers            x86_64          2.17-196.el7               local          675 k
 kernel-headers           x86_64          3.10.0-693.el7             local          6.0 M
 libmpc                   x86_64          1.0.1-3.el7                local           51 k
 libstdc++-devel          x86_64          4.8.5-16.el7               local          1.5 M

事务概要
==========================================================================================
安装  2 软件包 (+6 依赖软件包)

总下载量:39 M
安装大小:84 M
Downloading packages:
------------------------------------------------------------------------------------------
总计                                                       50 MB/s |  39 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : libmpc-1.0.1-3.el7.x86_64                                             1/8 
  正在安装    : cpp-4.8.5-16.el7.x86_64                                               2/8 
  正在安装    : libstdc++-devel-4.8.5-16.el7.x86_64                                   3/8 
  正在安装    : kernel-headers-3.10.0-693.el7.x86_64                                  4/8 
  正在安装    : glibc-headers-2.17-196.el7.x86_64                                     5/8 
  正在安装    : glibc-devel-2.17-196.el7.x86_64                                       6/8 
  正在安装    : gcc-4.8.5-16.el7.x86_64                                               7/8 
  正在安装    : gcc-c++-4.8.5-16.el7.x86_64                                           8/8 
  验证中      : kernel-headers-3.10.0-693.el7.x86_64                                  1/8 
  验证中      : gcc-c++-4.8.5-16.el7.x86_64                                           2/8 
  验证中      : libstdc++-devel-4.8.5-16.el7.x86_64                                   3/8 
  验证中      : libmpc-1.0.1-3.el7.x86_64                                             4/8 
  验证中      : cpp-4.8.5-16.el7.x86_64                                               5/8 
  验证中      : gcc-4.8.5-16.el7.x86_64                                               6/8 
  验证中      : glibc-devel-2.17-196.el7.x86_64                                       7/8 
  验证中      : glibc-headers-2.17-196.el7.x86_64                                     8/8 

已安装:
  gcc.x86_64 0:4.8.5-16.el7                 gcc-c++.x86_64 0:4.8.5-16.el7                

作为依赖被安装:
  cpp.x86_64 0:4.8.5-16.el7                  glibc-devel.x86_64 0:2.17-196.el7            
  glibc-headers.x86_64 0:2.17-196.el7        kernel-headers.x86_64 0:3.10.0-693.el7       
  libmpc.x86_64 0:1.0.1-3.el7                libstdc++-devel.x86_64 0:4.8.5-16.el7        

完毕!
[root@localhost inotify-tools-3.14]#./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for doxygen... NO_DOXYGEN
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking mcheck.h usability... yes
checking mcheck.h presence... yes
checking for mcheck.h... yes
checking whether sys/inotify.h actually works... yup
checking for an ANSI C-conforming const... yes
checking for inline... inline
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating libinotifytools/Makefile
config.status: creating libinotifytools/src/Makefile
config.status: creating libinotifytools/src/inotifytools/Makefile
config.status: creating config.h
config.status: creating libinotifytools/src/inotifytools/inotify.h
config.status: executing depfiles commands
config.status: executing libtool commands

おすすめ

転載: blog.csdn.net/IvyXYW/article/details/114276001