tech:go_lang_-_err_compilation_pour_windows_-_crosscompilation
Go lang - err compilation pour windows - crosscompilation
$ env GOOS=windows go build main.go # github.com/mappu/miqt/qt ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qaccessible_64bit.go:6:33: undefined: QAccessible__RelationFlag ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qgraphicsitem_64bit.go:6:36: undefined: QGraphicsItem__Extension ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:6:28: undefined: KeyboardModifier ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:7:21: undefined: Modifier ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:8:23: undefined: MouseButton ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:9:34: undefined: WindowType ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:10:22: undefined: InputMethodQuery ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:11:18: undefined: InputMethodQuery ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:12:29: undefined: InputMethodHint ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:13:23: undefined: GestureType ../../pkg/mod/github.com/mappu/miqt@v0.13.0/qt/gen_qnamespace_64bit.go:13:23: too many errors
$ env CGO_ENABLED=1 GOOS=windows go build main.go # runtime/cgo gcc: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’? ...
$ env GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ CGO_LDFLAGS="-lssp" go build -ldflags="-s -w" -o app1.exe main.go github.com/mappu/miqt/qt: exec: "i686-w64-mingw32-g++": executable file not found in $PATH ...
#sudo apt-get install gcc-multilib-i686-linux-gnu sudo apt-get install gcc-mingw-w64-bootstrap
$ env GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ CGO_LDFLAGS="-lssp" go build -ldflags="-s -w" -o app1.exe main.go
...
# github.com/mappu/miqt/qt
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qatomic.h:41,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qrefcount.h:43,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qbytearray.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/QByteArray:1,
from gen_qxmlstream.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:45:12: fatal error: type_traits: No such file or directory
45 | # include <type_traits>
| ^~~~~~~~~~~~~
compilation terminated.
Test en 64 bits :
sudo apt-get install gcc-mingw-w64-x86-64-win32 sudo apt-get install g++-mingw-w64-x86-64-win32
rm /tmp/go-* -rf go clean -cache -modcache -fuzzcache
env GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_LDFLAGS="-lssp" go build -ldflags="-s -w" -o app1.exe main.go
... 3755312453/000657.o /tmp/go-link-3755312453/000658.o /tmp/go-link-3755312453/000659.o /tmp/go-link-3755312453/000660.o /tmp/go-link-3755312453/000661.o /tmp/go-link-3755312453/000662.o /tmp/go-link-3755312453/000663.o /tmp/go-link-3755312453/000664.o /tmp/go-link-3755312453/000665.o /tmp/go-link-3755312453/000666.o /tmp/go-link-3755312453/000667.o /tmp/go-link-3755312453/000668.o /tmp/go-link-3755312453/000669.o /tmp/go-link-3755312453/000670.o /tmp/go-link-3755312453/000671.o /tmp/go-link-3755312453/000672.o /tmp/go-link-3755312453/000673.o /tmp/go-link-3755312453/000674.o /tmp/go-link-3755312453/000675.o /tmp/go-link-3755312453/000676.o /tmp/go-link-3755312453/000677.o /tmp/go-link-3755312453/000678.o /tmp/go-link-3755312453/000679.o /tmp/go-link-3755312453/000680.o /tmp/go-link-3755312453/000681.o /tmp/go-link-3755312453/000682.o /tmp/go-link-3755312453/000683.o /tmp/go-link-3755312453/000684.o /tmp/go-link-3755312453/000685.o /tmp/go-link-3755312453/000686.o /tmp/go-link-3755312453/000687.o /tmp/go-link-3755312453/000688.o /tmp/go-link-3755312453/000689.o /tmp/go-link-3755312453/000690.o -lssp -lQt5Widgets -lQt5Gui -lQt5Core -lssp -lssp -Wl,-T,/tmp/go-link-3755312453/fix_debug_gdb_scripts.ld -Wl,--start-group -lmingwex -lmingw32 -Wl,--end-group -lkernel32 /usr/bin/x86_64-w64-mingw32-ld.bfd: cannot find -lQt5Widgets: No existe el fichero o el directorio /usr/bin/x86_64-w64-mingw32-ld.bfd: cannot find -lQt5Gui: No existe el fichero o el directorio /usr/bin/x86_64-w64-mingw32-ld.bfd: cannot find -lQt5Core: No existe el fichero o el directorio collect2: error: ld returned 1 exit status
tech/go_lang_-_err_compilation_pour_windows_-_crosscompilation.txt · Dernière modification : de Jean-Baptiste
