-
Notifications
You must be signed in to change notification settings - Fork 22
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
is it possible to build win .exe's on linux? #50
Comments
I cannot read the command line. |
github.com/pwiecz/go-fltk: build constraints exclude all Go files in /home/mark/opt/gows/pkg/mod/github.com/pwiecz/[email protected] It seems related to this issue: |
The command line was: env GOOS=windows GOARCH=amd64 go build -o myapp.exe . |
I was able to get it working by specifying CGO_ENABLED=1 and specifying the cross-compiler, since according to the issue, the built-in C/C++ compiler in the golang toolchain isn't cross-compiling:
(uses the mingw cross-compiler) I was also able to get things working using the Zig toolchain:
|
I started by installing this:
Go insisted I add the -buildvcs=false flag and since I didn't want a console to pop up I added the -ldflags -H=windowsgui flag. This created myapp.exe which won't run on win 7, but runs perfectly on win 10. Note though that this depends on having mingw64 installed on windows and in the windows path: otherwise the .exe won't run because it can't find various dlls. So this approach does not produce a self-contained standalone .exe. Thank you! |
For command line applications I can usually build them on linux for windows using a command line like this:
But when I try this with a go-fltk app I get an error:
It is possible, or must I build for windows on windows?
The text was updated successfully, but these errors were encountered: