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

when executed go get -x github.com/sciter-sdk/go-sciter has error #310

Open euii opened 3 years ago

euii commented 3 years ago

I use macos big sur 11.4 and go version go1.15.13 darwin/amd64

  1. downloaded sdk and unzip to home folder
  2. cd ~/sciter-js-sdk-main/bin/macosx/
  3. export DYLD_LIBRARY_PATH=$PWD
  4. execute go get -x github.com/sciter-sdk/go-sciter

The following error has occurred

../../../../go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:110:145: 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
pravic commented 3 years ago

0.5.0 is way outdated. Use master, the errors were fixed in #257.

I, probably, need to update the tags.

pkaftj commented 3 years ago

Try this one https://github.com/pkaftj/sciter-go

euii commented 3 years ago

0.5.0 is way outdated. Use master, the errors were fixed in #257.

I, probably, need to update the tags.

Thank you so much, I'm stupid )))

euii commented 3 years ago

I have downloaded the master branch code, then downloaded the latest sdk from the official website, configured the DYLD_LIBRARY_PATH environment variables, and ran the following results.

my test code

package main

import (
    "github.com/sciter-sdk/go-sciter"
    "github.com/sciter-sdk/go-sciter/window"
)

func main()  {
    rect := sciter.NewRect(200,200,300,500)
    win, _ := window.New(sciter.SW_MAIN | sciter.SW_TITLEBAR, rect)
    win.SetTitle("load HTML page")
    win.LoadFile("./index.html")
    win.Show()
    win.Run()
}

my go mod

module SciterTest

go 1.15

require (
    github.com/sciter-sdk/go-sciter v0.5.1-0.20210404081253-a04e052a2813
)

error message

/usr/local/Cellar/go@1.15/1.15.13/libexec/bin/go build -o /private/var/folders/49/1wbzfqtd4_v0_38mdtrc0rh40000gn/T/___2go_build_SciterTest SciterTest #gosetup
# github.com/sciter-sdk/go-sciter
request.c:5:74: warning: non-void function does not return a value [-Wreturn-type]
request.c:6:78: warning: non-void function does not return a value [-Wreturn-type]
request.c:7:128: warning: non-void function does not return a value [-Wreturn-type]
request.c:8:142: warning: non-void function does not return a value [-Wreturn-type]
request.c:9:126: warning: non-void function does not return a value [-Wreturn-type]
request.c:10:141: warning: non-void function does not return a value [-Wreturn-type]
request.c:11:160: warning: non-void function does not return a value [-Wreturn-type]
request.c:12:133: warning: non-void function does not return a value [-Wreturn-type]
request.c:13:172: warning: non-void function does not return a value [-Wreturn-type]
request.c:14:174: warning: non-void function does not return a value [-Wreturn-type]
request.c:15:130: warning: non-void function does not return a value [-Wreturn-type]
request.c:16:131: warning: non-void function does not return a value [-Wreturn-type]
request.c:17:169: warning: non-void function does not return a value [-Wreturn-type]
request.c:18:171: warning: non-void function does not return a value [-Wreturn-type]
request.c:19:133: warning: non-void function does not return a value [-Wreturn-type]
request.c:20:171: warning: non-void function does not return a value [-Wreturn-type]
request.c:21:173: warning: non-void function does not return a value [-Wreturn-type]
request.c:22:179: warning: non-void function does not return a value [-Wreturn-type]
request.c:23:146: warning: non-void function does not return a value [-Wreturn-type]
request.c:24:111: warning: non-void function does not return a value [-Wreturn-type]
request.c:25:170: warning: non-void function does not return a value [-Wreturn-type]
request.c:26:165: warning: non-void function does not return a value [-Wreturn-type]
request.c:27:145: warning: non-void function does not return a value [-Wreturn-type]
request.c:28:130: warning: non-void function does not return a value [-Wreturn-type]
request.c:29:132: warning: non-void function does not return a value [-Wreturn-type]
request.c:30:124: warning: non-void function does not return a value [-Wreturn-type]
request.c:31:140: warning: non-void function does not return a value [-Wreturn-type]
request.c:32:137: warning: non-void function does not return a value [-Wreturn-type]
/private/var/folders/49/1wbzfqtd4_v0_38mdtrc0rh40000gn/T/___2go_build_SciterTest
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x0]

runtime stack:
runtime.throw(0x40ef2b7, 0x2a)
        /usr/local/Cellar/go@1.15/1.15.13/libexec/src/runtime/panic.go:1116 +0x72
runtime.sigpanic()
        /usr/local/Cellar/go@1.15/1.15.13/libexec/src/runtime/signal_unix.go:726 +0x48c

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x40b7630, 0xc00003ee68, 0x9313a88)
        /usr/local/Cellar/go@1.15/1.15.13/libexec/src/runtime/cgocall.go:133 +0x5b fp=0xc00003ee38 sp=0xc00003ee00 pc=0x400517b
github.com/sciter-sdk/go-sciter._Cfunc_SciterCreateWindow(0x82, 0xc00012e010, 0x0, 0x0, 0x0, 0x0)
        _cgo_gotypes.go:984 +0x4e fp=0xc00003ee68 sp=0xc00003ee38 pc=0x40af12e
github.com/sciter-sdk/go-sciter.CreateWindow.func1(0x82, 0xc00012e010, 0x0, 0x0, 0xc0001121e0)
        /Users/wangye/go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.1-0.20210404081253-a04e052a2813/sciter_darwin.go:26 +0x9d fp=0xc00003eeb0 sp=0xc00003ee68 pc=0x40b293d
github.com/sciter-sdk/go-sciter.CreateWindow(0x82, 0xc00012e010, 0x0, 0x0, 0x0, 0x400f4f8)
        /Users/wangye/go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.1-0.20210404081253-a04e052a2813/sciter_darwin.go:26 +0x4c fp=0xc00003eee8 sp=0xc00003eeb0 pc=0x40b1eec
github.com/sciter-sdk/go-sciter/window.New(0x82, 0xc00012e010, 0x0, 0x0, 0xffffffff)
        /Users/wangye/go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.1-0.20210404081253-a04e052a2813/window/window_darwin.go:57 +0x68 fp=0xc00003ef48 sp=0xc00003eee8 pc=0x40b4a28
main.main()
        /Users/wangye/Library/Mobile Documents/com~apple~CloudDocs/sciterTest/main.go:10 +0x65 fp=0xc00003ef88 sp=0xc00003ef48 pc=0x40b4e05
runtime.main()
        /usr/local/Cellar/go@1.15/1.15.13/libexec/src/runtime/proc.go:204 +0x209 fp=0xc00003efe0 sp=0xc00003ef88 pc=0x4036da9
runtime.goexit()
        /usr/local/Cellar/go@1.15/1.15.13/libexec/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc00003efe8 sp=0xc00003efe0 pc=0x4065961

Process finished with the exit code 2
euii commented 3 years ago

Try this one https://github.com/pkaftj/sciter-go

Ok, Thanks. Let me try it

happyRip commented 3 years ago

I don't see any progress here, but have encountered an issue myself having go 1.16.6. Couldn't install using sciter-sdk/go-sciter, so went for pkaftj/sciter-go. I've managed to install it, but I can't run any demoes. Here is an error that I get trying to run/build demo1 @pkaftj :

% go run demo1.go                                                                                                                        (main)sciter-go
# command-line-arguments
./demo1.go:23:17: cannot use "github.com/pkaftj/sciter-go".SW_TITLEBAR | "github.com/pkaftj/sciter-go".SW_RESIZEABLE | "github.com/pkaftj/sciter-go".SW_CONTROLS | "github.com/pkaftj/sciter-go".SW_MAIN | "github.com/pkaftj/sciter-go".SW_ENABLE_DEBUG (type "github.com/pkaftj/sciter-go".WindowCreationFlag) as type "github.com/iwctwbai/sciter-go".WindowCreationFlag in argument to window.New
geocine commented 2 years ago

I solved this @happyRip @euii . Need to do 2 things

  1. Use latest go-sciter SDK
      go get https://github.com/sciter-sdk/go-sciter@master
  2. Use sciter binaries from version 4.4.6.8 of sciter-js-sdk by checking out c27c567
      git clone git@github.com:c-smile/sciter-js-sdk.git
      git checkout c27c567

    Segmentation fault is caused by this https://github.com/sciter-sdk/go-sciter/issues/297. This is the last version of 4.4.6.x before the api changed in 4.4.7.0.

55utah commented 2 years ago

I solved this @happyRip @euii . Need to do 2 things

  1. Use latest go-sciter SDK
     go get https://github.com/sciter-sdk/go-sciter@master
  2. Use sciter binaries from version 4.4.6.8 of sciter-js-sdk by checking out c27c567
     git clone git@github.com:c-smile/sciter-js-sdk.git
     git checkout c27c567

Segmentation fault is caused by this #297. This is the last version of 4.4.6.x before the api changed in 4.4.7.0.

"git clone git@github.com:c-smile/sciter-js-sdk.git" is too big; "that sciter-js-sdk by checking out c27c567" can find from here (https://github.com/c-smile/sciter-js-sdk/commit/c27c5679d79ee94db8730ce06a7cda2bf5d3daba) by online, we can download the binaries online. (But I still can not solved this, I give up.)