Alpinel 编译软件注意事项

  1. 使用国内镜像,加速下载

  2. 安装 autoconf(无configure脚本时):apk add --no-cache -U autoconf

  3. 安装 C 编译器:apk add --no-cache -U gcc、apk add --no-cache -U libc-dev

  4. 安装 make

  5. 安装 linux 内核文件头 linux-headers:apk add --no-cache -U linux-headers

  6. 报:

    /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find Scrt1.o: No such file or directory

    /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory

    /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lssp_nonshared

    错误时需要安装 libc-dev:apk add --no-cache -U libc-dev

  7. 报 No curses library functions found,需安装 ncurses-dev:apk add --no-cache -U ncurses-dev

  8. Cannot locate header file libintl.h,需安装 gettext-dev:apk add --no-cache -U gettext-dev

  9. 安装 curl-dev 和 openssl-dev 时报:

    ERROR: unsatisfiable constraints:
      libressl-dev-2.7.5-r0:
        conflicts: openssl-dev-1.0.2r-r0[pc:libcrypto=2.7.5] openssl-dev-1.0.2r-r0[pc:libssl=2.7.5] openssl-dev-1.0.2r-r0[pc:openssl=2.7.5]
        satisfies: curl-dev-7.61.1-r2[libressl-dev] libssh2-dev-1.8.2-r0[pc:libcrypto] libssh2-dev-1.8.2-r0[pc:libssl]
      openssl-dev-1.0.2r-r0:
        conflicts: libressl-dev-2.7.5-r0[pc:libcrypto=1.0.2r] libressl-dev-2.7.5-r0[pc:libssl=1.0.2r] libressl-dev-2.7.5-r0[pc:openssl=1.0.2r]
        satisfies: world[openssl-dev] libssh2-dev-1.8.2-r0[pc:libcrypto] libssh2-dev-1.8.2-r0[pc:libssl]

    需改成 apk add --no-cache -U libressl-dev、apk add --no-cache -U curl-dev

  10. configure: error: Invalid C++ compiler or C++ compiler flags : apk add --no-cache -U g++

评论

暂无评论