CentOS、AnolisOS 龙蜥 源码编译 异常处理

常见异常

  1. 异常:

    /bin/sh: cc: command not found
    

    解决:

    yum -y install gcc
    
  2. 异常

    fatal error: openssl/ssl.h: No such file or directory
    #include <openssl/ssl.h>
    

    解决:

    yum -y install openssl-devel
    
  3. 异常

    fatal error: curl/curl.h: No such file or directory
    #include <curl/curl.h>
    

    解决:

    yum -y install curl-devel
    
  4. 异常

    fatal error: expat.h: No such file or directory
    #include <expat.h>
    

    解决:

    yum -y install expat-devel
    
  5. 异常

    -bash: make: command not found
    

    解决:

    yum -y install make
    
  6. 异常

    #include <jemalloc/jemalloc.h>
    

    解决:

    make MALLOC=libc
    
  7. 异常

    You need tcl 8.5 or newer in order to run the Redis test
    

    解决:

    yum -y install tcl
    
  8. 异常

    #error "Required C99 support is in a test phase
    

    解决:

    make CFLAGS=-std=c99
    
  9. 异常

    -bash: autoreconf: command not found
    

    解决:

    yum -y install autoconf
    
  10. 异常

    Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
    autoreconf: failed to run aclocal: No such file or directory
    

    解决:

    yum install -y libtool
    
  11. 异常

    configure: error: *** zlib.h missing - please install first or check config.log ***
    
    fatal error: zlib.h: No such file or directory
    # include <zlib.h>
    

    解决:

    yum -y install zlib-devel
    
  12. 异常

    configure: error: *** working libcrypto not found, check config.log
    error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
    

    解决:

    yum -y install openssl-devel
    
  13. 异常

    -bash: tar: command not found
    

    解决:

    yum -y install tar 
    
  14. 异常

    #error "Required C99 support is in a test phase.
    

    解决:

    make CFLAGS=-std=c99
    make CFLAGS=-std=c99 install
    
  15. 异常

    error: no acceptable C compiler found in $PATH
    

    解决

    yum -y install gcc
    
  16. 异常

    configure: error: 
      !!! OpenSSL is not properly installed on your system. !!!
      !!! Can not include OpenSSL headers files.            !!!
    

    解决

    yum -y install openssl-devel
    
  17. 异常

    *** WARNING - this build will not support IPVS with IPv6. Please install libnl/libnl-3 dev libraries to support IPv6 with IPVS.
    

    解决

    yum -y install libnl3-devel
    
  18. 异常

    src/haproxy.c:80:31: fatal error: systemd/sd-daemon.h: No such file or directory
     #include <systemd/sd-daemon.h>
    

    解决

    yum -y install systemd-devel
    
  19. 异常

    Please install libnl/libnl-3 dev libraries to support IPv6 with IPVS.
    

    解决:

    yum -y install libnl3-devel
    # yum -y install libnl-devel
    
  20. 异常

    unzip: command not found
    

    解决:

    yum -y install unzip
    
  21. 异常

    cmp: command not found
    

    解决:

    yum -y install diffutils
    
  22. 异常

        MSGFMT    po/bg.msg     MSGFMT    po/de.msg     MSGFMT    po/el.msg make[1]: *** [Makefile:160: po/bg.msg] Error 127
    make[1]: *** Waiting for unfinished jobs....
    make[1]: *** [Makefile:160: po/de.msg] Error 127
    make[1]: *** [Makefile:160: po/el.msg] Error 127
    

    解决:

    yum -y install gettext-devel
    
  23. 异常

    fatal error: libelf.h: No such file or directory
    #include <libelf.h>
    

    解决:

    yum -y install libbpf-devel
    

总结

  1. 如果遇见 #include <**xxx**.h>时,什么都不用考虑,直接取执行安装命令:yum -y install **xxx**-devel,然后进行重试