Closed sereeena closed 3 years ago
@sereeena the first thing that comes to mind is that you have different environment variables when you execute go build
manually. Could you paste the output of go env
here? That may be a module-related issue...
Discard my previous comment, it seems to be related to the mandatory use of CGO with the gl package.
You'll need to set the CGO_ENABLED
environment variable to 1
as well as CC
and CCX
.
Check out this comment to see an example of using those environment variables.
Oh thank you, setting CGO_ENABLED fixed the build on linux, but I'm still getting an error on the windows build
2021/05/31 16:59:25 bundling failed: bundling for environment windows/amd64 failed: building failed: # runtime/cgo
gcc: error: unrecognized command line option ‘-mthreads’; did you mean ‘-pthread’?
Do I need some further environment variables to be set?
Per this comment you need to set specific CC
and CCX
values for windows
Thank you, I was unfamiliar with CGO and cross compilation.
After installation of mingw toolchain on linux (sudo apt-get install gcc-mingw-w64) I was able to build for windows with CC=x86_64-w64-mingw32-gcc, CXX=x86_64-w64-mingw32-g++
Thanks again, will close this issue!
I have an astilectron bootstrapped application where I've been successfully using the bundler. When I recently modified one of my packages to use github.com/llgcode/draw2d/draw2dgl for drawing purposes, the inclusion of this package (which under the hood uses github.com/go-gl/gl/v2.1/gl) causes bundling to fail. (If I comment it out it works fine).
Here's the output of my astilectron-bundler call:
Is there a way to further debug the issue with the bundler build? If I run go build, or even if I execute the go build command with the same ldflags as the bundler, it builds correctly. I'm not sure what I could be doing wrong?