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

Failed to build with Go 1.9.2 #136

Open ying911008 opened 6 years ago

ying911008 commented 6 years ago

I use go1.9.2 windows/amd64 and TDM-GCC-64 in win10,but it can‘t work:

github.com/sciter-sdk/go-sciter

src\github.com\sciter-sdk\go-sciter\sciter.go:675[C:\Users\ZYQ\AppData\Local\Temp\go-build684847486\github.com\sciter-sdk\go-sciter_obj\sciter.cgo1.go:511:22]: cannot use bs (type _Ctype_LPCSTR) as type _Ctype_char in argument to _Cfunc_GoString src\github.com\sciter-sdk\go-sciter\sciter.go:806[C:\Users\ZYQ\AppData\Local\Temp\go-build684847486\github.com\sciter-sdk\go-sciter_obj\sciter.cgo1.go:652:5]: cannot use cname (type _Ctype_char) as type _Ctype_CHAR in argument to func literal src\github.com\sciter-sdk\go-sciter\sciter.go:823[C:\Users\ZYQ\AppData\Local\Temp\go-build684847486\github.com\sciter-sdk\go-sciter_obj\sciter.cgo1.go:675:5]: cannot use cname (type _Ctype_char) as type _Ctype_CHAR in argument to func literal src\github.com\sciter-sdk\go-sciter\sciter.go:885[C:\Users\ZYQ\AppData\Local\Temp\go-build684847486\github.com\sciter-sdk\go-sciter_obj\sciter.cgo1.go:748:5]: cannot use cname (type _Ctype_char) as type _Ctype_CHAR in argument to func literal src\github.com\sciter-sdk\go-sciter\sciter.go:897[C:\Users\ZYQ\AppData\Local\Temp\go-build684847486\github.com\sciter-sdk\go-sciter_obj\sciter.cgo1.go:771:5]: cannot use cname (type _Ctype_char) as type _Ctype_CHAR in argument to func literal src\github.com\sciter-sdk\go-sciter\types.go:596[C:\Users\ZYQ\AppData\Local\Temp\go-build684847486\github.com\sciter-sdk\go-sciter_obj\types.cgo1.go:527:26]: cannot use s.name (type _Ctype_LPCSTR) as type _Ctype_char in argument to _Cfunc_GoString src\github.com\sciter-sdk\go-sciter\types.go:979[C:\Users\ZYQ\AppData\Local\Temp\go-build684847486\github.com\sciter-sdk\go-sciter_obj\types.cgo1.go:725:26]: cannot use s.behaviorName (type _Ctype_LPCSTR) as type *_Ctype_char in argument to _Cfunc_GoString

pravic commented 6 years ago

1.9 is unsupported, unfortunately. The latest revision was 9646a0a383, I'll make a tag for that may be.

pravic commented 6 years ago

Could you use this version instead? https://github.com/sciter-sdk/go-sciter/releases/tag/go-1.9

ying911008 commented 6 years ago

yes, It can work well for me

ying911008 commented 6 years ago

this version can work in Go 1.9.5, but can't use in Go1.10.1

pravic commented 6 years ago

Exactly. They are incompatible.

If you can fix it - you're welcome :)

ying911008 commented 6 years ago

@pravic I‘m sorry, I just learned golang a few days. I have no power to do it.

waleson commented 6 years ago

C:\Users\waleson>gcc --version gcc (MinGW.org GCC-6.3.0-1) 6.3.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\Users\waleson>go version go version go1.10.1 windows/386

C:\Users\waleon>go get github.com\sciter-sdk\go-sciter

github.com/sciter-sdk/go-sciter

Warning: resolving _SciterHostCallback_cgo by linking to _SciterHostCallback_cgo@8 Use --enable-stdcall-fixup to disable these warnings Use --disable-stdcall-fixup to disable these fixups Warning: resolving _SciterElementCallback_cgo by linking to _SciterElementCallback_cgo@8 Warning: resolving _LPCWSTR_RECEIVER_cgo by linking to _LPCWSTR_RECEIVER_cgo@12 Warning: resolving _LPCSTR_RECEIVER_cgo by linking to _LPCSTR_RECEIVER_cgo@12 Warning: resolving _LPCBYTE_RECEIVER_cgo by linking to _LPCBYTE_RECEIVER_cgo@12 Warning: resolving _KeyValueCallback_cgo by linking to _KeyValueCallback_cgo@12 Warning: resolving _ElementEventProc_cgo by linking to _ElementEventProc_cgo@16 Warning: resolving _ELEMENT_COMPARATOR_cgo by linking to _ELEMENT_COMPARATOR_cgo@12

https://codeload.github.com/sciter-sdk/go-sciter/zip/go-1.9 only this version worked (with warning) for me.