How to make `go get` build against x86_64 instead of i386

I try to use either go-qml or getk3 to create a very simple desktop application that can run under OS X. However, when I try to use go get to install any library, it will try to create for i386 and skip the libraries that were created against x86_64. I could try to get a 32-bit version of these libraries, but I would prefer to build for a 64-bit version. How do I instruct to do this?

The warnings followed by errors are as follows:

 go get gopkg.in/qml.v1 # gopkg.in/qml.v1 ld: warning: ld: warning: ld: warning: ignoring file /usr/local/Cellar/qt5/5.3.2/lib/QtWidgets.framework/QtWidgets, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/qt5/5.3.2/lib/QtWidgets.framework/QtWidgetsignoring file /usr/local/Cellar/qt5/5.3.2/lib/QtGui.framework/QtGui, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/qt5/5.3.2/lib/QtGui.framework/QtGuiignoring file /usr/local/Cellar/qt5/5.3.2/lib/QtQuick.framework/QtQuick, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/qt5/5.3.2/lib/QtQuick.framework/QtQuick 
+5
source share
1 answer

Set the GOARCH environment GOARCH to amd64 . This gives the go command generate files for amd64 . Other valid values ​​for GOARCH are 386 and arm .

+4
source

Source: https://habr.com/ru/post/1206964/


All Articles