AlistGo / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
44.37k stars 5.75k forks source link

从源码编译时出现错误 #3098

Closed z836454898 closed 1 year ago

z836454898 commented 1 year ago

Please make sure of the following things

Alist Version / Alist 版本

v3.8.0

Driver used / 使用的存储驱动

PIkPak

Describe the bug / 问题描述

编译时产生如下错误: E:\project\alist>go build -ldflags="-w -s"

github.com/alist-org/alist/v3

D:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1 d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Swift\AppData\Local\Temp\go-link-3653606329\000016.o: in function _cgo_preinit_i nit': \\_\_\runtime\cgo/gcc_libinit_windows.c:40: undefined reference toimp___iob_func' d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Swift\AppData\Local\Temp\go-link-3653606329\000016.o: in function x_cgo_notify_r untime_init_done': \\_\_\runtime\cgo/gcc_libinit_windows.c:105: undefined reference toimp_iob_func' d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Swift\AppData\Local\Temp\go-link-3653606329\000016.o: in function _cgo_beginthre ad': \\_\_\runtime\cgo/gcc_libinit_windows.c:149: undefined reference toimp_iob_func' d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Swift\AppData\Local\Temp\go-link-3653606329\000017.o: in function x_cgo_thread_s tart': \\_\_\runtime\cgo/gcc_util.c:18: undefined reference to_impiob_func' collect2.exe: error: ld returned 1 exit status

Reproduction / 复现链接

我的gcc的版本是: image

golang的版本是: image

Logs / 日志

No response

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the issue template!

z836454898 commented 1 year ago

更换MSVCRT as runtime library的MinGW-w64就成功编译了 image image https://winlibs.com/#download-release