sciter-sdk / go-sciter

Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
https://sciter.com
2.57k stars 268 forks source link

Can't install on go1.16.6 linux/amd64 #313

Open immortalt opened 3 years ago

immortalt commented 3 years ago

I finished the previous steps to install sdk, but I failed to run the last command:

go get -x github.com/sciter-sdk/go-sciter

the error is:

EOF
/snap/go/7954/pkg/tool/linux_amd64/compile -o $WORK/b001/_pkg_.a -trimpath "$WORK/b001=>" -p github.com/sciter-sdk/go-sciter -buildid VgaeZjs39xGnGslqjW5p/VgaeZjs39xGnGslqjW5p -goversion go1.16.6 -D "" -importcfg $WORK/b001/importcfg -pack -c=4 /home/lenovo/go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/generate.go /home/lenovo/go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/types_string.go /home/lenovo/go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/value.go /home/lenovo/go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/wrapper.go $WORK/b001/_cgo_gotypes.go $WORK/b001/sciter.cgo1.go $WORK/b001/sciter_linux.cgo1.go $WORK/b001/types.cgo1.go $WORK/b001/utils.cgo1.go $WORK/b001/_cgo_import.go
# github.com/sciter-sdk/go-sciter
/home/lenovo/go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:1025:142: cannot use _cgo1 (type *_Ctype_HWINDOW) as type **_Ctype_struct__GtkWidget in argument to _Cfunc_SciterGetElementHwnd

which is very similar to #245. What should I do now to install the sdk?

laoshaw commented 2 years ago

this happens with go 1.17.2 as well

vikulin commented 2 years ago

Confirmed for golang 1.17.7. Full log:

$ cd examples/simple 
$ go build                   
# github.com/sciter-sdk/go-sciter
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:110:85: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterDataReady
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:141:85: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterDataReadyAsync
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:151:120: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterLoadFile
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:174:104: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterLoadHtml
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:242:142: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterSetCallback
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:296:60: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterSetCSS
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:319:110: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterSetMediaType
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:330:96: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterGetMinWidth
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:339:106: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterGetMinHeight
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:359:48: cannot use _cgo0 (type _Ctype_HWINDOW) as type unsafe.Pointer in argument to _Cfunc_SciterCall
../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:359:48: too many errors
$
vikulin commented 2 years ago

This solution works for me: https://github.com/sciter-sdk/go-sciter/issues/245#issuecomment-896794879