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.42k stars 744 forks source link

undefined: NewQByteArrayFromPointer #1041

Open kooksee opened 4 years ago

kooksee commented 4 years ago

When I ran the qt example, I encountered vendor/github.com/therecipe/qt/core/core.go: 15: 42: undefined: NewQByteArrayFromPointer.

The relevant environment configuration is as follows:

INFO[0000] GOOS:                        'darwin'        
INFO[0000] GOARCH:                      'amd64'         
INFO[0000] GOVERSION:                   'go1.13.1'      
INFO[0000] GOROOT:                   *  '/usr/local/Cellar/go/1.13.1/libexec' 
INFO[0000] GOPATH:                   *  '/Users/barry/gopath' 
INFO[0000] GOBIN:                       '/Users/barry/gopath/bin' 
INFO[0000] GOMOD:                       '/Users/barry/gopath/src/github.com/pubgo/examples/go.mod' 
INFO[0000] QT_HASH:                     'v0.0.0-20200103041036-2b818d970888' 
INFO[0000] QT_API:                      ''              
INFO[0000] QT_VERSION:                  '5.13.0'        
INFO[0000] QT_DIR:                   *  '/Users/barry/gopath/src/github.com/pubgo/examples/vendor/github.com/therecipe/env_darwin_amd64_513' 
INFO[0000] QT_STUB:                     'false'         
INFO[0000] QT_DEBUG:                    'false'         
INFO[0000] QT_QMAKE_DIR:                ''              
INFO[0000] QT_WEBKIT:                   'false'         
INFO[0000] QT_STATIC:                   'false'         
INFO[0000] QT_GEN_TSD:                  'false'         
INFO[0000] QT_GEN_OPENGL:               'false'         
INFO[0000] QT_GEN_QUICK_EXTRAS:         'false'         
INFO[0000] QT_RESOURCES_BIG:            'false'         
INFO[0000] QT_NOT_CACHED:               'false'         
INFO[0000] QT_HOMEBREW:                 'false'         
INFO[0000] QT_MACPORTS:                 'false'         
INFO[0000] QT_NIX:                      'false'         
INFO[0000] QT_FELGO:                    'false'         
INFO[0000] XCODE_DIR:                   '/Applications/Xcode.app' 
INFO[0000] QT_PKG_CONFIG:               'false'    

and my env_darwin_amd64_513 is also configured.

I found this problem when I ran qtsetup.

joshualley commented 4 years ago

I met the same problem. Do you find the solution?

jxltom commented 4 years ago

Same issue here in Ubuntu 16.04 with go1.14, a workaround is installing therecipe/qt with disabled go module.

jxltom commented 4 years ago

After some digging, I think it is because qtsetup didn't generate any modules, which might because github.com/therecipe/qt/internal/binding/files/docs/5.13.0 is missing in vendor directory.

Copy all packages to vendor might solves this issue since by default go mod vendor does't copy all files as reported in https://github.com/golang/go/issues/26366.

acemasterjb commented 3 years ago

@jxltom So you're saying a 5.12.11 version, for example, would still error out but 5.12.0 wouldn't?