Alpine编译报错

Golang Liemer_Lius 401℃

使用国内镜像,加速下载
安装 autoconf(无configure脚本时):
# apk add --no-cache -U autoconf

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

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

/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

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

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

安装 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

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

From: https://blog.csdn.net/weixin_39618456/article/details/116262337, QQQ

转载请注明:liutianfeng.com » Alpine编译报错

喜欢 (1)

评论已关闭。