Qt: Build constraints exclude all Go files in %GOPATH%\src\github.com\therecipe\qt\gui

Created on 11 Sep 2017  路  3Comments  路  Source: therecipe/qt

When i try to build using go build -o myapp.exe main.go, it exit with an error :

file.go: build constraints exclude all Go files in %GOPATH%\src\github.com\therecipe\qt\core
file.go: build constraints exclude all Go files in %GOPATH%\src\github.com\therecipe\qt\gui
file.go: build constraints exclude all Go files in %GOPATH%\src\github.com\therecipe\qt\widgets

I really don't know what to do, at first it was printing me the "unimplemented: 64-bit" error, so i changed GOARCH to 386 and it prints the following error now.

I thought "Maybe i need to re-run qtsetup with GOARCH=386", but when i do it, it prints

> qtsetup
...
`INFO[0001] GOARCH:                   *  'amd64'

> echo %GOARCH%
386

Here are my infos :

> systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name   : Microsoft Windows 10 Professionnel 脡ducation
OS Version : 10.0.14393 N/A version 14393

> go env
set GOARCH=386
set GOBIN=D:\Users\Litarvan\Documents\Go\bin
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\Users\Litarvan\Documents\Go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set GO386=sse2
set CC=gcc
set GOGCCFLAGS=-m32 -fmessage-length=0 -fdebug-prefix-map=D:\Users\Litarvan\AppData\Local\Temp\go-build623432363=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=0
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=D:/Qt/Tools/mingw530_32/bin/../libexec/gcc/i686-w64-mingw32/5.3.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-5.3.0/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw530/i686-530-posix-dwarf-rt_v4-rev0/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw530/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw530/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw530/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw530/prerequisites/i686-w64-mingw32-static --with-pkgversion='i686-posix-dwarf-rev0, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw530/i686-530-posix-dwarf-rt_v4-rev0/mingw32/opt/include -I/c/mingw530/prerequisites/i686-zlib-static/include -I/c/mingw530/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw530/i686-530-posix-dwarf-rt_v4-rev0/mingw32/opt/include -I/c/mingw530/prerequisites/i686-zlib-static/include -I/c/mingw530/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw530/i686-530-posix-dwarf-rt_v4-rev0/mingw32/opt/lib -L/c/mingw530/prerequisites/i686-zlib-static/lib -L/c/mingw530/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
Thread model: posix
gcc version 5.3.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)

Most helpful comment

Setting CGO_ENABLED to 1 fixed the issue ^^
(In fact, i found it by doing qtdeploy build desktop for the 15 times, in the wrong folder, it displayed me the args given to go build, and i saw this, so thanks @abhishekgarg120 )

All 3 comments

did you try the qtdeploy build desktop

also, you can use the docker method for building cross platform version, I am working on mac and deploying it for linux and windows without any issues.

qtdeploy build desktop works, but i don't want to do this each time i want to test my project.
And i'm not cross compiling, i'm simply compiling from windows to windows.

Setting CGO_ENABLED to 1 fixed the issue ^^
(In fact, i found it by doing qtdeploy build desktop for the 15 times, in the wrong folder, it displayed me the args given to go build, and i saw this, so thanks @abhishekgarg120 )

Was this page helpful?
0 / 5 - 0 ratings

Related issues

angiglesias picture angiglesias  路  5Comments

amlwwalker picture amlwwalker  路  3Comments

tjma2001 picture tjma2001  路  3Comments

xlucas picture xlucas  路  7Comments

iMaxopoly picture iMaxopoly  路  3Comments