Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windwos 编译出错 #124

Open
centaur679 opened this issue Apr 24, 2020 · 5 comments
Open

windwos 编译出错 #124

centaur679 opened this issue Apr 24, 2020 · 5 comments

Comments

@centaur679
Copy link

E:\github_source\spider>go build

github.com/Mirror-l/spider

D:\applications\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
D:/applications/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `C:\Users\TANGZU~1\AppData\Local\Temp\go-link-952364683\000000.o' is incompatible with i386:x86-64 output
collect2.exe: error: ld returned 1 exit status

@andeya
Copy link
Owner

andeya commented Apr 24, 2020

应该是gcc版本不兼容,解决办法是多尝试几个gcc版本或者注释掉gui模块

@yqchilde
Copy link

作者您好,我有同样的问题,我已经试过TMD-GCC,MinGW8.1.0, 7.3.0, 7.1.0等多个版本了,问题还是存在。

@yqchilde
Copy link

我希望看日志,所以需要build

@zgtxxxx
Copy link

zgtxxxx commented Jul 29, 2021

我也遇到这个问题了,C:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
E:/tools/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `C:\Users\ADMINI~1\AppData\Local\Temp\go-link-092415567\000000.o' is incompatible with i386:x86-64 output
collect2.exe: error: ld returned 1 exit status
编译不过去。

@GhostHallyz
Copy link

提供一种解决方式:
安装 rsrc 工具
go get github.com/akavel/rsrc
进入gui目录,重新生成syso文件
win32(x86):
rsrc -arch 386 -manifest main.exe.manifest
win64(x64):
rsrc -arch amd64 -manifest ./guimain.manifest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants