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

build on windows #127

Open
vlappa opened this issue Apr 29, 2024 · 5 comments
Open

build on windows #127

vlappa opened this issue Apr 29, 2024 · 5 comments

Comments

@vlappa
Copy link

vlappa commented Apr 29, 2024

Sorry I'm a complete windows noob. How do I build (go generate) go-fltk on Windows 10 amd64?

I've downloaded git bash, cmake, cygwin (in the hope it did me provided the build tools)
did go generate in git bash, but cmake says:
unable to find "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set.

Yes I've Google, but man very unclear how to install MinGW, which package is needed exactly etc.

@pwiecz
Copy link
Owner

pwiecz commented Apr 29, 2024

What I've used is TDM-GCC ( https://jmeubank.github.io/tdm-gcc/ )
After installing it (and cmake) I've run go generate from windows command prompt.
I had to build the final library with -buildmode=exe , but maybe it's not necessary now.

@vlappa
Copy link
Author

vlappa commented Apr 29, 2024

Thanks.

Error moving include\FL\fl_config.h to lib\windows\amd64\FL, rename include\FL\fl_config.h lib\windows\amd64\FL\fl_config.h: Permission denied. exit status 1

I executed the git bash shell as administrator.

@vlappa
Copy link
Author

vlappa commented Apr 29, 2024

cross compiling (latest) from linux to windows fails, as if go generate wasn't run, but those windows libs are available by default afaik:

GOOS=windows GOARCH=amd64 go build main.go

undefined: fltk.Window

Not sure if CGO_ENABLED=1 is needed for cross compilation , but with it added, it gives:

# runtime/cgo
gcc: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’?

@vlappa
Copy link
Author

vlappa commented Apr 29, 2024

I was able to build on Windows with a older version github.com/pwiecz/go-fltk v0.0.0-20230715112806-e23ae979a995
as go generate was not needed there.

@pwiecz
Copy link
Owner

pwiecz commented Jun 30, 2024

Have, you had an opportunity running go generate in the most recent version?

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

2 participants