running on max osx
indiscible opened this issue · 4 comments
hello, i have a problem at the linking stage when building the package:
ld: warning: ignoring file /usr/local/lib/libglfw.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/lib/libglfw.dylib
maybe its an architecture problem:
libglfw.dylib is a 64 bits shared library but when i run go get -x github.com/go-gl/glfw it seems the code is compiled in 32 bits :
gcc -I . -g -O2 -fPIC -m32 ...
I read the previous issue with had kind of the same problem and I am confused at why it doesn't work for me.
cheers
I am not sure why the -m32
part is in the GCC calls. Specially if your system is 64 bits.
Can you tell me what your GOARCH
environment variable is set to?
For me it's amd64
. I am not sure if this influences the GCC command line, but it's worth a try.
doh, i'm kinda new to go, how do check the value of GOARCH ?
I mean if i just do echo $GOARCH , i get nothing.
But if i look at the build it's definetly i386:
/usr/local/go/pkg/tool/darwin_386/cgo -objdir $WORK/github.com/go-gl/glfw/_obj/ -- -I/usr/local/include -I $WORK/github.com/go-gl/glfw/_obj/ callback.go glfw.go image.go vidmode.go
/usr/local/go/pkg/tool/darwin_386/8c -FVw -I $WORK/github.com/go-gl/glfw/_obj/ -I /usr/local/go/pkg/darwin_386 -o $WORK/github.com/go-gl/glfw/_obj/_cgo_defun.8 -DGOOS_darwin -DGOARCH_386 $WORK/github.com/go-gl/glfw/_obj/_cgo_defun.c
ok i'm so ashamed right now, I actually installed the i386 version of go on my machine.
No worries :) Hope this resolves the issue.