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

Why incompatibilities #700

Open
zhosi opened this issue Jul 27, 2020 · 4 comments
Open

Why incompatibilities #700

zhosi opened this issue Jul 27, 2020 · 4 comments

Comments

@zhosi
Copy link

zhosi commented Jul 27, 2020

D:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `C:\Users\user\AppData\Local\Temp\go-link-214766623\000000.o' is incompatible with i386:x86-64 output
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: $WORK\b001\exe\a.out.exe: .rsrc merge failure: corrupt .rsrc section
collect2.exe: error: ld returned 1 exit status

What is the reason for the incompatibility

@chenyu1990
Copy link

chenyu1990 commented Aug 9, 2020

go build -ldflags="-H windowsgui -linkmode internal"

@cryptonote-social
Copy link

@chenyu1990 unfortunately -linkmode internal causes other problems if you use cgo to bring in other C libraries.

Regarding the rsrc merge failure error, I found the fix for that problem here: josephspurrier/goversioninfo#39

Now I'm just trying to figure out how to work around the i386 incompatibility error.

@cryptonote-social
Copy link

Ahah, for the incompatibility error, use the -arch amd64 flag with that patched version of rsrc:

rsrc -arch amd64 -manifest test.manifest -o rsrc.syso

@tc-hib
Copy link

tc-hib commented Mar 5, 2021

Hello, I would like to delete my forks of rsrc and goversioninfo as my quick fix was rather bad. The bug has been properly fixed in rsrc, and I have developed my own tool too for more features: https://github.com/tc-hib/go-winres

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

4 participants