Добрый день!
Кто может подсказать как использовать Htmlayout / Sciter для компиляции MinGW?
Именно MinGW нужен т.к. используются сторонние библиотеки откомпилированные именно им.
Что я делал:
1) Скачел TDM64 (вроде как самый популярный порт MinGW) c
http://tdm-gcc.tdragon.net/download
2) Установил его в корень С:\
3) создал файл minimal.cpp
#include <windows.h>
#include "C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h"
int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
HWND wnd = ::CreateWindowEx(
0,
::SciterClassName(),
L"Minimal Sciter Application",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0,
800, 600,
0,0,0,0);
::SciterLoadFile(wnd, L"minimal.htm");
::ShowWindow(wnd, SW_SHOWNORMAL);
MSG msg;
while( ::IsWindow(wnd) && GetMessage(&msg, 0, 0, 0) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
4) выполнил комманду g++ -o demo_htmlayout.exe minimal.cpp
5) получаю ошибки:
C:\workspace\cpp\demo_htmlayout>g++ -o demo_htmlayout.exe minimal.cpp
In file included from C:\workspace\cpp_libs\sciter-sdk\include\value.hpp:26:0,
from C:\workspace\cpp_libs\sciter-sdk\include\value.h:293,
from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-def.h:24
,
from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:5,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\aux-cvt.h: In constructor 'aux::itot<CT
>::itot(int, int)':
C:\workspace\cpp_libs\sciter-sdk\include\aux-cvt.h:685:7: error: 'reverse' is no
t a member of 'std'
std::reverse(buffer,wstr);
^
C:\workspace\cpp_libs\sciter-sdk\include\aux-cvt.h: In constructor 'aux::ftoa::f
toa(double, const char*, int)':
C:\workspace\cpp_libs\sciter-sdk\include\aux-cvt.h:705:69: error: '_snprintf_s'
was not declared in this scope
_snprintf_s(buffer, 64, "%.*f%s", fractional_digits, d, units );
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\value.h:293:0,
from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-def.h:24
,
from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:5,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\value.hpp: In member function 'sciter::
value sciter::value::call()':
C:\workspace\cpp_libs\sciter-sdk\include\value.hpp:368:37: error: 'nullptr' was
not declared in this scope
value call() { return call(0,nullptr); }
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:4:0,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.h: At global scope:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-types.h:222:27: error: expecte
d unqualified-id before string constant
#define EXTERN_C extern "C"
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.h:171:10: note: in expansi
on of macro 'EXTERN_C'
OBSOLETE EXTERN_C SCDOM_RESULT SCAPI SciterGetElementHtml(HELEMENT he, LPCBYTE*
utf8bytes, BOOL outer);
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-types.h:222:27: error: expecte
d unqualified-id before string constant
#define EXTERN_C extern "C"
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.h:191:11: note: in expansi
on of macro 'EXTERN_C'
OBSOLETE EXTERN_C SCDOM_RESULT SCAPI SciterGetElementText(HELEMENT he, LPWSTR*
utf16);
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\tiscript.hpp:6:0,
from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-api.h:11
,
from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:8,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\tiscript-streams.hpp: In constructor 't
iscript::file_istream::file_istream(const WCHAR*)':
C:\workspace\cpp_libs\sciter-sdk\include\tiscript-streams.hpp:76:40: error: '_wf
open_s' was not declared in this scope
_wfopen_s(&_file,filename,L"rb");
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-api.h:11
:0,
from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:8,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\tiscript.hpp: At global scope:
C:\workspace\cpp_libs\sciter-sdk\include\tiscript.hpp:10:72: error: 'nullptr' wa
s not declared in this scope
inline tiscript_native_interface* ni(tiscript_native_interface* ni = nullptr)
^
C:\workspace\cpp_libs\sciter-sdk\include\tiscript.hpp: In function 'tiscript_nat
ive_interface* tiscript::ni(tiscript_native_interface*)':
C:\workspace\cpp_libs\sciter-sdk\include\tiscript.hpp:12:45: error: 'nullptr' wa
s not declared in this scope
static tiscript_native_interface* _ni = nullptr;
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-api.h:11
:0,
from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:8,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\tiscript.hpp: In constructor 'tiscript:
:args::error::error(int, const char*)':
C:\workspace\cpp_libs\sciter-sdk\include\tiscript.hpp:363:86: error: 'sprintf_s'
was not declared in this scope
sprintf_s(buffer, "parameter %d, expecting %s", param_n-2, expectin
g_type);
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:8:0,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-api.h: At global scope:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-api.h:265:48: error: 'nullptr'
was not declared in this scope
inline ISciterAPI* SAPI( ISciterAPI* ext = nullptr ) {
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-api.h: In function 'ISciterAPI
* SAPI(ISciterAPI*)':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-api.h:266:34: error: 'nullptr'
was not declared in this scope
static ISciterAPI* _api = nullptr;
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:13:0,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp: In member function 's
citer::string sciter::dom::element::combine_url(const string&) const':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp:623:7: error: 'copy_n'
is not a member of 'std'
std::copy_n(relative_url.cbegin(), length, buffer);
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp:623:32: error: 'const
string' has no member named 'cbegin'
std::copy_n(relative_url.cbegin(), length, buffer);
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp: In member function 'h
tml::element* sciter::dom::element::find_first(const char*, ...) const':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp:690:40: error: 'vsprin
tf_s' was not declared in this scope
vsprintf( buffer, selector, args );
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp: In member function 'v
oid sciter::dom::element::find_all(sciter::dom::callback*, const char*, ...) con
st':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp:703:40: error: 'vsprin
tf_s' was not declared in this scope
vsprintf( buffer, selector, args );
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp: In member function 'h
tml::element* sciter::dom::element::find_nearest_parent(const char*, ...) const'
:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp:715:40: error: 'vsprin
tf_s' was not declared in this scope
vsprintf( buffer, selector, args );
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp: In member function 'b
ool sciter::dom::element::test(const char*, ...) const':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-dom.hpp:730:40: error: 'vsprin
tf_s' was not declared in this scope
vsprintf( buffer, selector, args );
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:14:0,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-host-callback.h: In function '
bool sciter::load_resource_data(HINSTANCE, LPCWSTR, const BYTE*&, UINT&)':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-host-callback.h:228:60: error:
'wcsncpy_s' was not declared in this scope
WCHAR achURL[MAX_PATH]; wcsncpy_s(achURL, uri, MAX_PATH);
^
In file included from C:\workspace\cpp_libs\sciter-sdk\include\sciter-x.h:15:0,
from minimal.cpp:5:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h: In member function 'v
oid sciter::debug_output::printf(const char*, ...)':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:77:49: error: 'vsprint
f_s' was not declared in this scope
int len = vsprintf_s( buffer, fmt, args );
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h: At global scope:
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:229:15: error: 'functi
on' in namespace 'std' does not name a type
typedef std::function<void(const WCHAR* fileUrl, unsigned lineNo)> breakp
oint_receiver_t;
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:262:38: error: 'std::f
unction' has not been declared
void dbg_enumBreakpoints( std::function<void(const WCHAR* fileUrl, unsign
ed lineNo)> receiver ) {
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:262:46: error: expecte
d ',' or '...' before '<' token
void dbg_enumBreakpoints( std::function<void(const WCHAR* fileUrl, unsign
ed lineNo)> receiver ) {
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h: In member function 'v
oid sciter::script_debugger_client::dbg_enumBreakpoints(int)':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:263:52: error: 'receiv
er' was not declared in this scope
SciterDebugEnumBreakpoints(hSciterHost, &receiver, _SCITER_DEBUG_BREA
KPOINT_CB);
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h: In static member func
tion 'static BOOL sciter::script_debugger_client::_SCITER_DEBUG_BREAKPOINT_CB(LP
CWSTR, UINT, LPVOID)':
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:291:9: error: 'breakpo
int_receiver_t' was not declared in this scope
breakpoint_receiver_t* bpr = static_cast<breakpoint_receiver_t*>(param)
;
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:291:32: error: 'bpr' w
as not declared in this scope
breakpoint_receiver_t* bpr = static_cast<breakpoint_receiver_t*>(param)
;
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:291:50: error: expecte
d type-specifier before 'breakpoint_receiver_t'
breakpoint_receiver_t* bpr = static_cast<breakpoint_receiver_t*>(param)
;
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:291:50: error: expecte
d '>' before 'breakpoint_receiver_t'
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:291:50: error: expecte
d '(' before 'breakpoint_receiver_t'
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:291:72: error: expecte
d primary-expression before '>' token
breakpoint_receiver_t* bpr = static_cast<breakpoint_receiver_t*>(param)
;
^
C:\workspace\cpp_libs\sciter-sdk\include\sciter-x-debug.h:291:80: error: expecte
d ')' before ';' token
breakpoint_receiver_t* bpr = static_cast<breakpoint_receiver_t*>(param)
;
^
minimal.cpp: In function 'int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)':
minimal.cpp:20:10: error: cannot convert 'LPCWSTR {aka const wchar_t*}' to 'LPCS
TR {aka const char*}' for argument '2' to 'HWND__* CreateWindowExA(DWORD, LPCSTR
, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)'
0,0,0,0);
^
Как правильно использовать Htmlayout / Sciter с MinGW?
Спасибо!