therecipe / qt

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
GNU Lesser General Public License v3.0
10.49k stars 748 forks source link

Error when run qtsetup on Mac OS 10.13.4 Beta (17E160e) invalid flag in #cgo CFLAGS: -arch #559

Closed W-B-S closed 6 years ago

W-B-S commented 6 years ago

INFO[0125] installing full qt/core
ERRO[0126] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/core" env= error="exit status 1" func=RunCmdOptionalError name="install core" github.com/therecipe/qt github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0126] installing full qt/androidextras
ERRO[0126] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/androidextras" env= error="exit status 1" func=RunCmdOptionalError name="install androidextras" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0126] installing full qt/gui
ERRO[0126] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/gui" env= error="exit status 1" func=RunCmdOptionalError name="install gui" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0126] installing full qt/network
ERRO[0126] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/network" env= error="exit status 1" func=RunCmdOptionalError name="install network" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0126] installing full qt/xml
ERRO[0126] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/xml" env= error="exit status 1" func=RunCmdOptionalError name="install xml" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0126] installing full qt/dbus
ERRO[0126] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/dbus" env= error="exit status 1" func=RunCmdOptionalError name="install dbus" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0126] installing full qt/nfc
ERRO[0126] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/nfc" env= error="exit status 1" func=RunCmdOptionalError name="install nfc" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0126] installing full qt/script
ERRO[0127] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/script" env= error="exit status 1" func=RunCmdOptionalError name="install script" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0127] installing full qt/sensors
ERRO[0127] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/sensors" env= error="exit status 1" func=RunCmdOptionalError name="install sensors" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0127] installing full qt/positioning
ERRO[0127] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/positioning" env= error="exit status 1" func=RunCmdOptionalError name="install positioning" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0127] installing full qt/widgets
ERRO[0127] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/widgets" env= error="exit status 1" func=RunCmdOptionalError name="install widgets" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0127] installing full qt/sql
ERRO[0127] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/sql" env= error="exit status 1" func=RunCmdOptionalError name="install sql" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0127] installing full qt/macextras
ERRO[0127] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/macextras" env= error="exit status 1" func=RunCmdOptionalError name="install macextras" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0127] installing full qt/qml
ERRO[0127] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/qml" env= error="exit status 1" func=RunCmdOptionalError name="install qml" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0127] installing full qt/websockets
ERRO[0127] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/websockets" env= error="exit status 1" func=RunCmdOptionalError name="install websockets" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0127] installing full qt/xmlpatterns
ERRO[0128] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/xmlpatterns" env= error="exit status 1" func=RunCmdOptionalError name="install xmlpatterns" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0128] installing full qt/bluetooth
ERRO[0128] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/bluetooth" env= error="exit status 1" func=RunCmdOptionalError name="install bluetooth" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0128] installing full qt/webchannel
ERRO[0128] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/webchannel" env= error="exit status 1" func=RunCmdOptionalError name="install webchannel" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0128] installing full qt/svg
ERRO[0128] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/svg" env= error="exit status 1" func=RunCmdOptionalError name="install svg" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0128] installing full qt/multimedia
ERRO[0128] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/multimedia" env= error="exit status 1" func=RunCmdOptionalError name="install multimedia" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0128] installing full qt/quick
ERRO[0128] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/quick" env= error="exit status 1" func=RunCmdOptionalError name="install quick" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0128] installing full qt/help
ERRO[0128] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/help" env= error="exit status 1" func=RunCmdOptionalError name="install help" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0128] installing full qt/location
ERRO[0129] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/location" env= error="exit status 1" func=RunCmdOptionalError name="install location" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0129] installing full qt/scripttools
ERRO[0129] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/scripttools" env= error="exit status 1" func=RunCmdOptionalError name="install scripttools" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0129] installing full qt/uitools
ERRO[0129] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/uitools" env= error="exit status 1" func=RunCmdOptionalError name="install uitools" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0129] installing full qt/webengine
ERRO[0129] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/webengine" env= error="exit status 1" func=RunCmdOptionalError name="install webengine" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0129] installing full qt/testlib
ERRO[0129] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/testlib" env= error="exit status 1" func=RunCmdOptionalError name="install testlib" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0129] installing full qt/serialport
ERRO[0129] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/serialport" env= error="exit status 1" func=RunCmdOptionalError name="install serialport" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0129] installing full qt/serialbus
ERRO[0129] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/serialbus" env= error="exit status 1" func=RunCmdOptionalError name="install serialbus" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0129] installing full qt/printsupport
ERRO[0129] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/printsupport" env= error="exit status 1" func=RunCmdOptionalError name="install printsupport" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0129] installing full qt/designer
ERRO[0130] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/designer" env= error="exit status 1" func=RunCmdOptionalError name="install designer" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0130] installing full qt/scxml
ERRO[0130] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/scxml" env= error="exit status 1" func=RunCmdOptionalError name="install scxml" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0130] installing full qt/gamepad
ERRO[0130] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/gamepad" env= error="exit status 1" func=RunCmdOptionalError name="install gamepad" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0130] installing full qt/purchasing
ERRO[0130] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/purchasing" env= error="exit status 1" func=RunCmdOptionalError name="install purchasing" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0130] installing full qt/datavisualization
ERRO[0130] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/datavisualization" env= error="exit status 1" func=RunCmdOptionalError name="install datavisualization" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0130] installing full qt/charts
ERRO[0130] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/charts" env= error="exit status 1" func=RunCmdOptionalError name="install charts" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0130] installing full qt/speech
ERRO[0130] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/speech" env= error="exit status 1" func=RunCmdOptionalError name="install speech" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0130] installing full qt/quickcontrols2
ERRO[0130] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/quickcontrols2" env= error="exit status 1" func=RunCmdOptionalError name="install quickcontrols2" github.com/therecipe/qt/quickcontrols2 go build github.com/therecipe/qt/quickcontrols2: invalid flag in #cgo CFLAGS: -arch

INFO[0130] installing full qt/sailfish
ERRO[0131] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/sailfish" env= error="exit status 1" func=RunCmdOptionalError name="install sailfish" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

INFO[0131] installing full qt/webview
ERRO[0131] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/webview" env= error="exit status 1" func=RunCmdOptionalError name="install webview" github.com/therecipe/qt/webview go build github.com/therecipe/qt/webview: invalid flag in #cgo CFLAGS: -arch

INFO[0131] installing full qt/remoteobjects
ERRO[0131] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/remoteobjects" env= error="exit status 1" func=RunCmdOptionalError name="install remoteobjects" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

WARN[0131] failed to install:
WARN[0131] core
WARN[0131] androidextras
WARN[0131] gui
WARN[0131] network
WARN[0131] xml
WARN[0131] dbus
WARN[0131] nfc
WARN[0131] script
WARN[0131] sensors
WARN[0131] positioning
WARN[0131] widgets
WARN[0131] sql
WARN[0131] macextras
WARN[0131] qml
WARN[0131] websockets
WARN[0131] xmlpatterns
WARN[0131] bluetooth
WARN[0131] webchannel
WARN[0131] svg
WARN[0131] multimedia
WARN[0131] quick
WARN[0131] help
WARN[0131] location
WARN[0131] scripttools
WARN[0131] uitools
WARN[0131] webengine
WARN[0131] testlib
WARN[0131] serialport
WARN[0131] serialbus
WARN[0131] printsupport
WARN[0131] designer
WARN[0131] scxml
WARN[0131] gamepad
WARN[0131] purchasing
WARN[0131] datavisualization
WARN[0131] charts
WARN[0131] speech
WARN[0131] quickcontrols2
WARN[0131] sailfish
WARN[0131] webview
WARN[0131] remoteobjects
INFO[0131] running: 'qtsetup test darwin' [docker=false] [vagrant=false] INFO[0131] testing quick/calc
ERRO[0143] failed to run command cmd="go build -p 4 -v -ldflags=all=\"-w\" \"-r=/Users/wsli/Qt/5.10.1/clang_64/lib\" -o /Users/wsli/go/src/github.com/therecipe/qt/internal/examples/quick/calc/deploy/darwin/calc.app/Contents/MacOS/calc -tags=\"minimal\"" env= error="exit status 1" func=RunCmd name="build for darwin on darwin" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

localhost:~ wsli$

SirNeural commented 6 years ago

Getting the same problem, albeit less verbose when trying to build a test application using Qt Widgets using the example given in the Getting Started portion of the wiki

ERRO[0088] failed to run command cmd="go build -p 8 -v -ldflags=all=\"-w\" \"-r=/usr/local/opt/qt5/lib\" -o /Users/username/golang/src/test.dev/deploy/darwin/test.dev.app/Contents/MacOS/test.dev -tags=\"minimal\"" env= error="exit status 1" func=RunCmd name="build for darwin on darwin" github.com/therecipe/qt/core go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

Currently running OSX 10.3.3 High Sierra and with Go 1.10

W-B-S commented 6 years ago

localhost:~ wsli$ go env GOARCH="amd64" GOBIN="" GOCACHE="/Users/wsli/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/wsli/go" GORACE="" GOROOT="/usr/local/Cellar/go/1.10/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.10/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0j/8lghc3kd7yx2c_1lp9zhc6_h0000gn/T/go-build160152071=/tmp/go-build -gno-record-gcc-switches -fno-common" localhost:~ wsli$

W-B-S commented 6 years ago

localhost:~ wsli$ go version go version go1.10 darwin/amd64

W-B-S commented 6 years ago

The solution: https://github.com/golang/go/wiki/InvalidFlag My situation: export CGO_CFLAGS_ALLOW="-arch|x86_64|-isysroot"

W-B-S commented 6 years ago

final fantasy

export CGO_CFLAGS_ALLOW="-arch|x86_64|-isysroot|/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk" export CGO_CXXFLAGS_ALLOW="-stdlib=libc++|-arch|x86_64|-isysroot|/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk|-F/Users/wsli/Qt/5.9.3/clang_64/lib" export CGO_LDFLAGS_ALLOW="-stdlib=libc++|-arch|x86_64|-isysroot|/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk|-F/Users/wsli/Qt/5.9.3/clang_64/lib|-headerpad_max_install_names|-Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk|-mmacosx-version-min=10.10|-Wl,-rpath,@executable_path/Frameworks"

ernstvanzyl commented 6 years ago

Also check #549 for a more generic solution.

therecipe commented 6 years ago

Hey

This should be fixed now with: https://github.com/therecipe/qt/commit/299f21022aa217faace4fae811ddd2ede4e35c9d

theMomax commented 6 years ago

Hi,

I'm still getting this error when trying to build for iOS. I am on commit 299f210 and the normal setup command for macOS works fine and all the tests complete successfully. But as I said, cross compilation doesn't:

qtsetup full ios && qtsetup full ios-simulator 
INFO[0000] running: 'qtsetup prep'                      
INFO[0000] successfully created qtrcc symlink in your PATH (/usr/local/bin/qtrcc) 
INFO[0000] successfully created qtmoc symlink in your PATH (/usr/local/bin/qtmoc) 
INFO[0000] successfully created qtminimal symlink in your PATH (/usr/local/bin/qtminimal) 
INFO[0000] successfully created qtdeploy symlink in your PATH (/usr/local/bin/qtdeploy) 
INFO[0000] running: 'qtsetup check ios' [docker=false] [vagrant=false] 
INFO[0000] GOOS:                        'darwin'        
INFO[0000] GOARCH:                      'amd64'         
INFO[0000] GOVERSION:                   'go1.10'        
INFO[0000] GOROOT:                      '/usr/local/Cellar/go/1.10/libexec' 
INFO[0000] GOPATH:                   *  '/Volumes/Data/themomax/Development/go' 
INFO[0000] GOBIN:                    *  '/Volumes/Data/themomax/Development/go/bin' 
INFO[0000] QT_HASH:                     'f1d82edc122bc2fae734ef735cccc74ff6cbed6e' 
INFO[0000] QT_VERSION:               *  '5.10.1'        
INFO[0000] QT_VERSION_MAJOR:            '5.10.1'        
INFO[0000] QT_DIR:                   *  '/Volumes/Data/themomax/Development/Qt' 
INFO[0000] QT_STUB:                  *  'false'         
INFO[0000] QT_DEBUG:                 *  'false'         
INFO[0000] QT_QMAKE_DIR:                ''              
INFO[0000] QT_WEBKIT:                   'false'         
INFO[0000] QT_HOMEBREW:                 'false'         
INFO[0000] XCODE_DIR:                   '/Applications/Xcode.app' 
INFO[0000] running: 'qtsetup generate ios' [docker=false] [vagrant=false] 
INFO[0003] generating cgo qt/core                       
INFO[0004] generating cgo qt/gui                        
INFO[0004] generating cgo qt/network                    
INFO[0005] generating cgo qt/xml                        
INFO[0006] generating cgo qt/nfc                        
INFO[0007] generating cgo qt/script                     
INFO[0007] generating cgo qt/sensors                    
INFO[0008] generating cgo qt/positioning                
INFO[0009] generating cgo qt/widgets                    
INFO[0009] generating cgo qt/sql                        
INFO[0010] generating cgo qt/qml                        
INFO[0018] generating cgo qt/websockets                 
INFO[0019] generating cgo qt/xmlpatterns                
INFO[0020] generating cgo qt/bluetooth                  
INFO[0020] generating cgo qt/webchannel                 
INFO[0028] generating cgo qt/svg                        
INFO[0028] generating cgo qt/multimedia                 
INFO[0029] generating cgo qt/quick                      
INFO[0036] generating cgo qt/help                       
INFO[0037] generating cgo qt/location                   
INFO[0044] generating cgo qt/scripttools                
INFO[0045] generating cgo qt/uitools                    
INFO[0045] generating cgo qt/testlib                    
INFO[0046] generating cgo qt/scxml                      
INFO[0053] generating cgo qt/gamepad                    
INFO[0054] generating cgo qt/purchasing                 
INFO[0054] generating cgo qt/datavisualization          
INFO[0055] generating cgo qt/charts                     
INFO[0056] generating cgo qt/speech                     
INFO[0057] generating cgo qt/quickcontrols2             
INFO[0064] generating cgo qt/sailfish                   
INFO[0064] generating cgo qt/webview                    
INFO[0071] generating cgo qt/remoteobjects              
INFO[0072] running: 'qtsetup install ios' [docker=false] [vagrant=false] 
INFO[0072] running: 'qtsetup test ios' [docker=false] [vagrant=false] 
INFO[0072] testing quick/calc                           
ERRO[0084] failed to run command                         cmd="go build -p 4 -v -ldflags=all=\"-w\" -o /Volumes/Data/themomax/Development/go/src/github.com/therecipe/qt/internal/examples/quick/calc/deploy/ios/libgo.a -tags=\"ios\" \"minimal\" -pkgdir /Volumes/Data/themomax/Development/go/pkg/ios_darwin_arm64 -buildmode c-archive" env="GOARCH=arm64 CGO_CPPFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=10.0 -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=10.0 -arch arm64 GOOS=darwin CGO_ENABLED=1 PATH=:/usr/local/Cellar/qt/5.10.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Volumes/Data/themomax/Development/go/bin GOPATH=/Volumes/Data/themomax/Development/go GOROOT=/usr/local/Cellar/go/1.10/libexec" error="exit status 1" func=RunCmd name="build for ios on darwin"
errors
internal/race
runtime/internal/sys
runtime/internal/atomic
sync/atomic
math
unicode/utf8
internal/testlog
runtime
unicode
runtime/cgo
strconv
sync
io
reflect
syscall
strings
time
internal/poll
os
fmt
log
github.com/therecipe/qt
github.com/therecipe/qt/core
go build github.com/therecipe/qt/core: invalid flag in #cgo CFLAGS: -arch

I did export the following:

export CGO_CXXFLAGS_ALLOW=".*" 
export CGO_LDFLAGS_ALLOW=".*" 
export CGO_CFLAGS_ALLOW=".*"

I'm running go1.10 on HighSierra 10.13.4 (17E199)

therecipe commented 6 years ago

@theMomax Could you re-run go install -v github.com/therecipe/qt/cmd/... and then try again? Maybe you still have an older version of the tools. (Since it says f1d82ed in the log and you said you are on 299f210)

I just tested it with the same specs, and it should work.

therecipe commented 6 years ago

@theMomax Also please not that there is an outstanding issue for the iOS targets with Go 1.10: https://github.com/therecipe/qt/issues/544 So you may need to use Go 1.9.5 atm (at least for the qml and moc stuff)

theMomax commented 6 years ago

Thanks for your fast response !

In deed I forgot to update your qt tools. Now the qtsetup command works and all example apps are "successfully" executed. None returns an error, but some/most don't show any content, but just a black screen. Sometimes the deploy/ios-simulator folder isn't created, which also is the case for my application. When I open the Xcode project of any of the applications, I get the following issues:

cp: /path/to/the/app's/root/directory/deploy/ios/qt.conf: No such file or directory
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure

Still some of them work and show content. However, mine (and some others) don't even start. Xcode says: SELECTED_DEVICE cannot run BINARY_FILE. BINARY_FILE does not have an architecture that SELECTED_DEVICE can execute. Some examples:

therecipe commented 6 years ago

@theMomax No problem.

I looked into this and it should be fixed now with: https://github.com/therecipe/qt/commit/856baca876f2362b409bfd531e738f651453f0fd (at least the qml related issues)

I'm not sure about the

cp: /path/to/the/app's/root/directory/deploy/ios/qt.conf: No such file or directory Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure

issue though, maybe try again to see if you can reproduce it after running qtdeploy test ios or qtdeploy test ios-simulator

Still some of them work and show content. However, mine (and some others) don't even start. Xcode says: SELECTED_DEVICE cannot run BINARY_FILE. BINARY_FILE does not have an architecture that SELECTED_DEVICE can execute.

This sounds like you just selected the wrong device in Xcode. (You can choose the device/simulator near the build and run button) Applications created with qtdeploy build ios-simulator will only work on the simulators and applications created with qtdeploy build ios will only work on real devices.

qml/adding: doesn't start/crashes on start, because of the selected-device/binary file problem (does not have a ios-simulator folder, so I used the Xcode project in the deploy/ios folder)

Yeah, the qml/adding example is a non visual example iirc that shows the basic usage of properties. I probably should add some visual element though.

Also maybe try run to run qtdeploy test ios-simulator, if you want to test your example on one of the simulators.

theMomax commented 6 years ago

All the tests are successful now and show content. They'll be enough reference to get mine working too. I just have to get the project-structure right... Thank you !