Re[2]: Htmlayout / Sciter c MinGW
От: littlesam  
Дата: 10.10.14 21:44
Оценка:
Перепроверил. MinGW-64 — полная поддержка WinApi и С++11 на уровне GCC 4.8

Зашел с другой стороны, кросс-компилияция используя MinGW-64 c убунты.
Тест проводился на демке minimal.cpp
#include <windows.h>
#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;
}


Компилятор выдает:
i686-w64-mingw32-g++ -m32 -mwindows   -c -O2 -w -s -I../../../Downloads/_old/sciter-sdk/include -std=c++11 -MMD -MP -MF "build/Release/i686-w64-mingw32-Linux-x86/minimal.o.d" -o build/Release/i686-w64-mingw32-Linux-x86/minimal.o minimal.cpp
In file included from ../../../Downloads/_old/sciter-sdk/include/value.hpp:26:0,
                 from ../../../Downloads/_old/sciter-sdk/include/value.h:293,
                 from ../../../Downloads/_old/sciter-sdk/include/sciter-x-def.h:24,
                 from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:5,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/aux-cvt.h: In constructor ‘aux::itot<CT>::itot(int, int)’:
../../../Downloads/_old/sciter-sdk/include/aux-cvt.h:685:7: error: ‘reverse’ is not a member of ‘std’
       std::reverse(buffer,wstr);
       ^
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:4:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-dom.h: At global scope:
../../../Downloads/_old/sciter-sdk/include/sciter-x-types.h:222:27: error: expected unqualified-id before string constant
   #define EXTERN_C extern "C"
                           ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-dom.h:171:10: note: in expansion of macro ‘EXTERN_C’
 OBSOLETE EXTERN_C SCDOM_RESULT SCAPI SciterGetElementHtml(HELEMENT he, LPCBYTE* utf8bytes, BOOL outer);
          ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-types.h:222:27: error: expected unqualified-id before string constant
   #define EXTERN_C extern "C"
                           ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-dom.h:191:11: note: in expansion of macro ‘EXTERN_C’
  OBSOLETE EXTERN_C SCDOM_RESULT SCAPI SciterGetElementText(HELEMENT he, LPWSTR* utf16);
           ^
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:5:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-def.h:483:57: error: ‘ID2D1RenderTarget’ has not been declared
 EXTERN_C BOOL SCAPI SciterRenderD2D(HWINDOW hWndSciter, ID2D1RenderTarget* prt);
                                                         ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-def.h:495:42: error: ‘ID2D1Factory’ was not declared in this scope
 EXTERN_C BOOL SCAPI     SciterD2DFactory(ID2D1Factory ** ppf);
                                          ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-def.h:495:58: error: ‘ppf’ was not declared in this scope
 EXTERN_C BOOL SCAPI     SciterD2DFactory(ID2D1Factory ** ppf);
                                                          ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-def.h:507:41: error: ‘IDWriteFactory’ was not declared in this scope
 EXTERN_C BOOL SCAPI     SciterDWFactory(IDWriteFactory ** ppf);
                                         ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-def.h:507:59: error: ‘ppf’ was not declared in this scope
 EXTERN_C BOOL SCAPI     SciterDWFactory(IDWriteFactory ** ppf);
                                                           ^
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:8:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:57:55: error: ‘ID2D1RenderTarget’ has not been declared
   BOOL    SCFN( SciterRenderD2D )(HWINDOW hWndSciter, ID2D1RenderTarget* prt);
                                                       ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:58:36: error: ‘ID2D1Factory’ has not been declared
   BOOL    SCFN( SciterD2DFactory )(ID2D1Factory ** ppf);
                                    ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:59:35: error: ‘IDWriteFactory’ has not been declared
   BOOL    SCFN( SciterDWFactory )(IDWriteFactory ** ppf);
                                   ^
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:8:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:375:62: error: ‘ID2D1RenderTarget’ has not been declared
   inline  BOOL    SCAPI SciterRenderD2D (HWINDOW hWndSciter, ID2D1RenderTarget* prt) { return SAPI()->SciterRenderD2D (hWndSciter,prt); }
                                                              ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:376:43: error: ‘SciterD2DFactory’ declared as an ‘inline’ variable
   inline  BOOL    SCAPI SciterD2DFactory (ID2D1Factory ** ppf) { return SAPI()->SciterD2DFactory (ppf); }
                                           ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:376:43: error: redefinition of ‘BOOL SciterD2DFactory’
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:5:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-def.h:495:25: error: ‘BOOL SciterD2DFactory’ previously defined here
 EXTERN_C BOOL SCAPI     SciterD2DFactory(ID2D1Factory ** ppf);
                         ^
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:8:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:376:43: error: ‘ID2D1Factory’ was not declared in this scope
   inline  BOOL    SCAPI SciterD2DFactory (ID2D1Factory ** ppf) { return SAPI()->SciterD2DFactory (ppf); }
                                           ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:376:59: error: ‘ppf’ was not declared in this scope
   inline  BOOL    SCAPI SciterD2DFactory (ID2D1Factory ** ppf) { return SAPI()->SciterD2DFactory (ppf); }
                                                           ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:377:42: error: ‘SciterDWFactory’ declared as an ‘inline’ variable
   inline  BOOL    SCAPI SciterDWFactory (IDWriteFactory ** ppf) { return SAPI()->SciterDWFactory (ppf); }
                                          ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:377:42: error: redefinition of ‘BOOL SciterDWFactory’
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:5:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-def.h:507:25: error: ‘BOOL SciterDWFactory’ previously defined here
 EXTERN_C BOOL SCAPI     SciterDWFactory(IDWriteFactory ** ppf);
                         ^
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:8:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:377:42: error: ‘IDWriteFactory’ was not declared in this scope
   inline  BOOL    SCAPI SciterDWFactory (IDWriteFactory ** ppf) { return SAPI()->SciterDWFactory (ppf); }
                                          ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-api.h:377:60: error: ‘ppf’ was not declared in this scope
   inline  BOOL    SCAPI SciterDWFactory (IDWriteFactory ** ppf) { return SAPI()->SciterDWFactory (ppf); }
                                                            ^
In file included from ../../../Downloads/_old/sciter-sdk/include/sciter-x.h:14:0,
                 from minimal.cpp:5:
../../../Downloads/_old/sciter-sdk/include/sciter-x-host-callback.h: In function ‘bool sciter::load_resource_data(HINSTANCE, LPCWSTR, const BYTE*&, UINT&)’:
../../../Downloads/_old/sciter-sdk/include/sciter-x-host-callback.h:228:60: error: invalid conversion from ‘LPCWSTR {aka const wchar_t*}’ to ‘size_t {aka unsigned int}’ [-fpermissive]
     WCHAR achURL[MAX_PATH]; wcsncpy_s(achURL, uri, MAX_PATH);
                                                            ^
../../../Downloads/_old/sciter-sdk/include/sciter-x-host-callback.h:228:60: error: invalid conversion from ‘int’ to ‘const wchar_t*’ [-fpermissive]
../../../Downloads/_old/sciter-sdk/include/sciter-x-host-callback.h:228:60: error: too few arguments to function ‘errno_t wcsncpy_s(wchar_t*, size_t, const wchar_t*, size_t)’
In file included from /usr/share/mingw-w64/include/string.h:176:0,
                 from /usr/share/mingw-w64/include/guiddef.h:148,
                 from /usr/share/mingw-w64/include/winnt.h:602,
                 from /usr/share/mingw-w64/include/minwindef.h:146,
                 from /usr/share/mingw-w64/include/windef.h:8,
                 from /usr/share/mingw-w64/include/windows.h:69,
                 from minimal.cpp:4:
/usr/share/mingw-w64/include/sec_api/string_s.h:53:27: note: declared here
   _CRTIMP errno_t __cdecl wcsncpy_s(wchar_t *_Dst,size_t _DstSizeInChars,const wchar_t *_Src,size_t _MaxCount);
                           ^
minimal.cpp: In function ‘int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)’:
minimal.cpp:19:10: error: cannot convert ‘LPCWSTR {aka const wchar_t*}’ to ‘LPCSTR {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);
          ^
In file included from /usr/share/mingw-w64/include/excpt.h:9:0,
                 from /usr/share/mingw-w64/include/windows.h:65,
                 from minimal.cpp:4:
/usr/share/mingw-w64/include/sec_api/stdio_s.h: In instantiation of ‘int sprintf_s(char (&)[__size], const char*, ...) [with unsigned int __size = 512u]’:
../../../Downloads/_old/sciter-sdk/include/tiscript.hpp:363:86:   required from here
/usr/share/mingw-w64/include/sec_api/stdio_s.h:30:3: error: ‘vsprintf_s’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
   __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1_ARGLIST(int,sprintf_s,vsprintf_s,char,_DstBuf,const char*,_Format)
   ^
In file included from /usr/share/mingw-w64/include/excpt.h:9:0,
                 from /usr/share/mingw-w64/include/windows.h:65,
                 from minimal.cpp:4:
/usr/share/mingw-w64/include/sec_api/stdio_s.h:48:3: note: ‘template<unsigned int __size> int vsprintf_s(char (&)[__size], const char*, va_list)’ declared here, later in the translation unit
   __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2(int, vsprintf_s, char, _DstBuf, const char*, _Format, va_list, _ArgList)
   ^
make[2]: *** [build/Release/i686-w64-mingw32-Linux-x86/minimal.o] Error 1
make[2]: Leaving directory `/home/alex/Workspace/netbeans/CppApplication_1'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/alex/Workspace/netbeans/CppApplication_1'
make: *** [.build-impl] Error 2


На WinApi с помощью MinGW-64 писал пока только примитивные приложения, очень заинтересовали продукты TerraInformatica, от возможности использовать их с MinGW-64 зависит, собственно говоря, заниматься дальше C/C++ или уйти целиком обратно в .NET

Подскажите хотя бы в какую сторону копать чтоб разобраться с проблемой, C++11 MinGW-64 вроде как поддерижвает (https://ru.wikipedia.org/w/index.php?title=MinGW&amp;veaction=edit&amp;vesection=4). Линковать .lib файлы позволяет. В исходниках Sciter есть папочка bin.gtk что говорит о том что с GCC его уже скрещивали или пытались. MinGW-64 — это "порт" GCC 4.8, что подсказывает что с использованием Sciter/HTMLayout с MinGW-64 я упускаю что-то очевидное и истина находится где-то рядом...
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.