Open arjunmenon opened 4 months ago
Running on windows 11.
Tried the example: https://github.com/sciter-sdk/go-sciter/tree/master/examples/simple
Also used Adguards version. I basically go mod vendored the modules, copied the C files and ran the example. This was the result:
# github.com/sciter-sdk/go-sciter sciter-x-api.c: In function 'SAPI': sciter-x-api.c:37:13: error: unknown type name 'SciterAPI_ptr'; did you mean 'ISciterAPI'? 37 | SciterAPI_ptr sciterAPI = (SciterAPI_ptr) GetProcAddress(hm, "SciterAPI"); | ^~~~~~~~~~~~~ | ISciterAPI sciter-x-api.c:37:40: error: 'SciterAPI_ptr' undeclared (first use in this function); did you mean 'sciterAPI'? 37 | SciterAPI_ptr sciterAPI = (SciterAPI_ptr) GetProcAddress(hm, "SciterAPI"); | ^~~~~~~~~~~~~ | sciterAPI sciter-x-api.c:37:40: note: each undeclared identifier is reported only once for each function it appears in sciter-x-api.c:37:55: error: expected ',' or ';' before 'GetProcAddress' 37 | SciterAPI_ptr sciterAPI = (SciterAPI_ptr) GetProcAddress(hm, "SciterAPI"); | ^~~~~~~~~~~~~~ sciter-x-api.c:39:22: error: called object 'sciterAPI' is not a function or function pointer 39 | _api = sciterAPI(); | ^~~~~~~~~ sciter-x-api.c:37:27: note: declared here 37 | SciterAPI_ptr sciterAPI = (SciterAPI_ptr) GetProcAddress(hm, "SciterAPI"); | ^~~~~~~~~ sciter-x-api.c: At top level: sciter-x-api.c:226:18: error: conflicting types for 'SciterD2DFactory' 226 | BOOL SCAPI SciterD2DFactory (void** /*ID2D1Factory ***/ ppf) { return SAPI(NULL)->SciterD2DFactory (ppf); } | ^~~~~~~~~~~~~~~~ In file included from vendor\github.com\sciter-sdk\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\sciter-sdk\go-sciter/sciter-x-def.h:592:18: note: previous declaration of 'SciterD2DFactory' was here 592 | SBOOL SCAPI SciterD2DFactory(IUnknown** /*ID2D1Factory ***/ ppf); | ^~~~~~~~~~~~~~~~ sciter-x-api.c: In function 'SciterD2DFactory': sciter-x-api.c:226:107: warning: passing argument 1 of 'SAPI(0)->SciterD2DFactory' from incompatible pointer type [-Wincompatible-pointer-types] 226 | BOOL SCAPI SciterD2DFactory (void** /*ID2D1Factory ***/ ppf) { return SAPI(NULL)->SciterD2DFactory (ppf); } | ^~~ | | | void ** sciter-x-api.c:226:107: note: expected 'IUnknown **' but argument is of type 'void **' sciter-x-api.c: At top level: sciter-x-api.c:227:18: error: conflicting types for 'SciterDWFactory' 227 | BOOL SCAPI SciterDWFactory (void** /*IDWriteFactory ***/ ppf) { return SAPI(NULL)->SciterDWFactory (ppf); } | ^~~~~~~~~~~~~~~ In file included from vendor\github.com\sciter-sdk\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\sciter-sdk\go-sciter/sciter-x-def.h:604:18: note: previous declaration of 'SciterDWFactory' was here 604 | SBOOL SCAPI SciterDWFactory(IUnknown** /*IDWriteFactory ***/ ppf); | ^~~~~~~~~~~~~~~ sciter-x-api.c: In function 'SciterDWFactory': sciter-x-api.c:227:107: warning: passing argument 1 of 'SAPI(0)->SciterDWFactory' from incompatible pointer type [-Wincompatible-pointer-types] 227 | BOOL SCAPI SciterDWFactory (void** /*IDWriteFactory ***/ ppf) { return SAPI(NULL)->SciterDWFactory (ppf); } | ^~~ | | | void ** sciter-x-api.c:227:107: note: expected 'IUnknown **' but argument is of type 'void **' sciter-x-api.c: At top level: sciter-x-api.c:274:22: error: conflicting types for 'SciterShowPopupAt' 274 | SCDOM_RESULT SCAPI SciterShowPopupAt(HELEMENT hePopup, POINT pos, BOOL animate) { return SAPI(NULL)->SciterShowPopupAt(hePopup,pos,animate); } | ^~~~~~~~~~~~~~~~~ In file included from vendor\github.com\sciter-sdk\go-sciter/sciter-x-def.h:35, from vendor\github.com\sciter-sdk\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\sciter-sdk\go-sciter/sciter-x-dom.h:542:20: note: previous declaration of 'SciterShowPopupAt' was here 542 | SCDOM_RESULT SCAPI SciterShowPopupAt(HELEMENT hePopup, POINT pos, UINT placement); | ^~~~~~~~~~~~~~~~~ sciter-x-api.c:288:22: error: conflicting types for 'SciterSendEvent' 288 | SCDOM_RESULT SCAPI SciterSendEvent( HELEMENT he, UINT appEventCode, HELEMENT heSource, UINT reason, /*out*/ BOOL* handled) { return SAPI(NULL)->SciterSendEvent( he,appEventCode,heSource,reason,handled); } | ^~~~~~~~~~~~~~~ In file included from vendor\github.com\sciter-sdk\go-sciter/sciter-x-def.h:35, from vendor\github.com\sciter-sdk\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\sciter-sdk\go-sciter/sciter-x-dom.h:682:20: note: previous declaration of 'SciterSendEvent' was here 682 | SCDOM_RESULT SCAPI SciterSendEvent( | ^~~~~~~~~~~~~~~ sciter-x-api.c:289:22: error: conflicting types for 'SciterPostEvent' 289 | SCDOM_RESULT SCAPI SciterPostEvent( HELEMENT he, UINT appEventCode, HELEMENT heSource, UINT reason) { return SAPI(NULL)->SciterPostEvent(he,appEventCode,heSource,reason); } | ^~~~~~~~~~~~~~~ In file included from vendor\github.com\sciter-sdk\go-sciter/sciter-x-def.h:35, from vendor\github.com\sciter-sdk\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\sciter-sdk\go-sciter/sciter-x-dom.h:695:20: note: previous declaration of 'SciterPostEvent' was here 695 | SCDOM_RESULT SCAPI SciterPostEvent( HELEMENT he, UINT appEventCode, HELEMENT heSource, UINT_PTR reason); | ^~~~~~~~~~~~~~~ sciter-x-api.c:311:52: error: unknown type name 'tiscript_value' 311 | SCDOM_RESULT SCAPI SciterGetObject( HELEMENT he, tiscript_value* pval, BOOL forceCreation ) { return SAPI(NULL)->SciterGetObject( he, pval, forceCreation ); } | ^~~~~~~~~~~~~~ sciter-x-api.c:312:63: error: unknown type name 'tiscript_value' 312 | SCDOM_RESULT SCAPI SciterGetElementNamespace( HELEMENT he, tiscript_value* pval) { return SAPI(NULL)->SciterGetElementNamespace( he,pval); } | ^~~~~~~~~~~~~~ sciter-x-api.c:334:3: error: unknown type name 'HVM' 334 | HVM SCAPI SciterGetVM( HWINDOW hwnd ) { return SAPI(NULL)->SciterGetVM(hwnd); } | ^~~ sciter-x-api.c: In function 'SciterGetVM': sciter-x-api.c:334:65: error: 'ISciterAPI' {aka 'struct _ISciterAPI'} has no member named 'SciterGetVM'; did you mean 'SciterGetPPI'? 334 | HVM SCAPI SciterGetVM( HWINDOW hwnd ) { return SAPI(NULL)->SciterGetVM(hwnd); } | ^~~~~~~~~~~ | SciterGetPPI sciter-x-api.c: At top level: sciter-x-api.c:366:25: error: unknown type name 'HVM' 366 | BOOL SCAPI Sciter_v2V(HVM vm, const tiscript_value script_value, VALUE* out_value, BOOL isolate) { return SAPI(NULL)->Sciter_v2V(vm,script_value,out_value, isolate); } | ^~~ sciter-x-api.c:366:39: error: unknown type name 'tiscript_value' 366 | BOOL SCAPI Sciter_v2V(HVM vm, const tiscript_value script_value, VALUE* out_value, BOOL isolate) { return SAPI(NULL)->Sciter_v2V(vm,script_value,out_value, isolate); } | ^~~~~~~~~~~~~~ sciter-x-api.c:367:25: error: unknown type name 'HVM' 367 | BOOL SCAPI Sciter_V2v(HVM vm, const VALUE* value, tiscript_value* out_script_value) { return SAPI(NULL)->Sciter_V2v(vm,value,out_script_value); } | ^~~ sciter-x-api.c:367:53: error: unknown type name 'tiscript_value' 367 | BOOL SCAPI Sciter_V2v(HVM vm, const VALUE* value, tiscript_value* out_script_value) { return SAPI(NULL)->Sciter_V2v(vm,value,out_script_value); } | ^~~~~~~~~~~~~~ # github.com/AdguardTeam/go-sciter sciter-x-api.c: In function 'SAPI': sciter-x-api.c:37:13: error: unknown type name 'SciterAPI_ptr'; did you mean 'ISciterAPI'? 37 | SciterAPI_ptr sciterAPI = (SciterAPI_ptr) GetProcAddress(hm, "SciterAPI"); | ^~~~~~~~~~~~~ | ISciterAPI sciter-x-api.c:37:40: error: 'SciterAPI_ptr' undeclared (first use in this function); did you mean 'sciterAPI'? 37 | SciterAPI_ptr sciterAPI = (SciterAPI_ptr) GetProcAddress(hm, "SciterAPI"); | ^~~~~~~~~~~~~ | sciterAPI sciter-x-api.c:37:40: note: each undeclared identifier is reported only once for each function it appears in sciter-x-api.c:37:55: error: expected ',' or ';' before 'GetProcAddress' 37 | SciterAPI_ptr sciterAPI = (SciterAPI_ptr) GetProcAddress(hm, "SciterAPI"); | ^~~~~~~~~~~~~~ sciter-x-api.c:39:22: error: called object 'sciterAPI' is not a function or function pointer 39 | _api = sciterAPI(); | ^~~~~~~~~ sciter-x-api.c:37:27: note: declared here 37 | SciterAPI_ptr sciterAPI = (SciterAPI_ptr) GetProcAddress(hm, "SciterAPI"); | ^~~~~~~~~ sciter-x-api.c: At top level: sciter-x-api.c:226:18: error: conflicting types for 'SciterD2DFactory' 226 | BOOL SCAPI SciterD2DFactory (void** /*ID2D1Factory ***/ ppf) { return SAPI(NULL)->SciterD2DFactory (ppf); } | ^~~~~~~~~~~~~~~~ In file included from vendor\github.com\AdguardTeam\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\AdguardTeam\go-sciter/sciter-x-def.h:592:18: note: previous declaration of 'SciterD2DFactory' was here 592 | SBOOL SCAPI SciterD2DFactory(IUnknown** /*ID2D1Factory ***/ ppf); | ^~~~~~~~~~~~~~~~ sciter-x-api.c: In function 'SciterD2DFactory': sciter-x-api.c:226:107: warning: passing argument 1 of 'SAPI(0)->SciterD2DFactory' from incompatible pointer type [-Wincompatible-pointer-types] 226 | BOOL SCAPI SciterD2DFactory (void** /*ID2D1Factory ***/ ppf) { return SAPI(NULL)->SciterD2DFactory (ppf); } | ^~~ | | | void ** sciter-x-api.c:226:107: note: expected 'IUnknown **' but argument is of type 'void **' sciter-x-api.c: At top level: sciter-x-api.c:227:18: error: conflicting types for 'SciterDWFactory' 227 | BOOL SCAPI SciterDWFactory (void** /*IDWriteFactory ***/ ppf) { return SAPI(NULL)->SciterDWFactory (ppf); } | ^~~~~~~~~~~~~~~ In file included from vendor\github.com\AdguardTeam\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\AdguardTeam\go-sciter/sciter-x-def.h:604:18: note: previous declaration of 'SciterDWFactory' was here 604 | SBOOL SCAPI SciterDWFactory(IUnknown** /*IDWriteFactory ***/ ppf); | ^~~~~~~~~~~~~~~ sciter-x-api.c: In function 'SciterDWFactory': sciter-x-api.c:227:107: warning: passing argument 1 of 'SAPI(0)->SciterDWFactory' from incompatible pointer type [-Wincompatible-pointer-types] 227 | BOOL SCAPI SciterDWFactory (void** /*IDWriteFactory ***/ ppf) { return SAPI(NULL)->SciterDWFactory (ppf); } | ^~~ | | | void ** sciter-x-api.c:227:107: note: expected 'IUnknown **' but argument is of type 'void **' sciter-x-api.c: At top level: sciter-x-api.c:274:22: error: conflicting types for 'SciterShowPopupAt' 274 | SCDOM_RESULT SCAPI SciterShowPopupAt(HELEMENT hePopup, POINT pos, BOOL animate) { return SAPI(NULL)->SciterShowPopupAt(hePopup,pos,animate); } | ^~~~~~~~~~~~~~~~~ In file included from vendor\github.com\AdguardTeam\go-sciter/sciter-x-def.h:35, from vendor\github.com\AdguardTeam\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\AdguardTeam\go-sciter/sciter-x-dom.h:542:20: note: previous declaration of 'SciterShowPopupAt' was here 542 | SCDOM_RESULT SCAPI SciterShowPopupAt(HELEMENT hePopup, POINT pos, UINT placement); | ^~~~~~~~~~~~~~~~~ sciter-x-api.c:288:22: error: conflicting types for 'SciterSendEvent' 288 | SCDOM_RESULT SCAPI SciterSendEvent( HELEMENT he, UINT appEventCode, HELEMENT heSource, UINT reason, /*out*/ BOOL* handled) { return SAPI(NULL)->SciterSendEvent( he,appEventCode,heSource,reason,handled); } | ^~~~~~~~~~~~~~~ In file included from vendor\github.com\AdguardTeam\go-sciter/sciter-x-def.h:35, from vendor\github.com\AdguardTeam\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\AdguardTeam\go-sciter/sciter-x-dom.h:682:20: note: previous declaration of 'SciterSendEvent' was here 682 | SCDOM_RESULT SCAPI SciterSendEvent( | ^~~~~~~~~~~~~~~ sciter-x-api.c:289:22: error: conflicting types for 'SciterPostEvent' 289 | SCDOM_RESULT SCAPI SciterPostEvent( HELEMENT he, UINT appEventCode, HELEMENT heSource, UINT reason) { return SAPI(NULL)->SciterPostEvent(he,appEventCode,heSource,reason); } | ^~~~~~~~~~~~~~~ In file included from vendor\github.com\AdguardTeam\go-sciter/sciter-x-def.h:35, from vendor\github.com\AdguardTeam\go-sciter/sciter-x.h:27, from sciter-x-api.c:1: vendor\github.com\AdguardTeam\go-sciter/sciter-x-dom.h:695:20: note: previous declaration of 'SciterPostEvent' was here 695 | SCDOM_RESULT SCAPI SciterPostEvent( HELEMENT he, UINT appEventCode, HELEMENT heSource, UINT_PTR reason); | ^~~~~~~~~~~~~~~ sciter-x-api.c:311:52: error: unknown type name 'tiscript_value' 311 | SCDOM_RESULT SCAPI SciterGetObject( HELEMENT he, tiscript_value* pval, BOOL forceCreation ) { return SAPI(NULL)->SciterGetObject( he, pval, forceCreation ); } | ^~~~~~~~~~~~~~ sciter-x-api.c:312:63: error: unknown type name 'tiscript_value' 312 | SCDOM_RESULT SCAPI SciterGetElementNamespace( HELEMENT he, tiscript_value* pval) { return SAPI(NULL)->SciterGetElementNamespace( he,pval); } | ^~~~~~~~~~~~~~ sciter-x-api.c:334:3: error: unknown type name 'HVM' 334 | HVM SCAPI SciterGetVM( HWINDOW hwnd ) { return SAPI(NULL)->SciterGetVM(hwnd); } | ^~~ sciter-x-api.c: In function 'SciterGetVM': sciter-x-api.c:334:65: error: 'ISciterAPI' {aka 'struct _ISciterAPI'} has no member named 'SciterGetVM'; did you mean 'SciterGetPPI'? 334 | HVM SCAPI SciterGetVM( HWINDOW hwnd ) { return SAPI(NULL)->SciterGetVM(hwnd); } | ^~~~~~~~~~~ | SciterGetPPI sciter-x-api.c: At top level: sciter-x-api.c:366:25: error: unknown type name 'HVM' 366 | BOOL SCAPI Sciter_v2V(HVM vm, const tiscript_value script_value, VALUE* out_value, BOOL isolate) { return SAPI(NULL)->Sciter_v2V(vm,script_value,out_value, isolate); } | ^~~ sciter-x-api.c:366:39: error: unknown type name 'tiscript_value' 366 | BOOL SCAPI Sciter_v2V(HVM vm, const tiscript_value script_value, VALUE* out_value, BOOL isolate) { return SAPI(NULL)->Sciter_v2V(vm,script_value,out_value, isolate); } | ^~~~~~~~~~~~~~ sciter-x-api.c:367:25: error: unknown type name 'HVM' 367 | BOOL SCAPI Sciter_V2v(HVM vm, const VALUE* value, tiscript_value* out_script_value) { return SAPI(NULL)->Sciter_V2v(vm,value,out_script_value); } | ^~~ sciter-x-api.c:367:53: error: unknown type name 'tiscript_value' 367 | BOOL SCAPI Sciter_V2v(HVM vm, const VALUE* value, tiscript_value* out_script_value) { return SAPI(NULL)->Sciter_V2v(vm,value,out_script_value); } | ^~~~~~~~~~~~~~
Running on windows 11.
Tried the example: https://github.com/sciter-sdk/go-sciter/tree/master/examples/simple
Also used Adguards version. I basically go mod vendored the modules, copied the C files and ran the example. This was the result: