wx-3.3.3 cross-compilation error

17 views
Skip to first unread message

Сергей Коныгин

unread,
Jul 9, 2026, 1:17:47 PM (yesterday) Jul 9
to wx-users
Hi!

Everything works fine when compiling for Windows using 32-bit MinGW. A compilation error occurs when using the cross-compiler (installed on Debian 12.6). I am configuring wxWidgets using the following lines

GXX=i686-w64-mingw32
../configure --host=$GXX --disable-shared --enable-monolithic --with-msw --with-expat --enable-sockets
make -j16

Here is a list of errors.  What am I doing wrong?

configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: Not using native pkg-config when cross-compiling.
configure: WARNING: system zlib library not found or too old, will use built-in instead
configure: WARNING: system png library not found or too old, will use built-in instead
configure: WARNING: system jpeg library not found, will use built-in instead
configure: WARNING: system webp library not found, will use built-in instead
configure: WARNING: system tiff library not found, will use built-in instead
configure: WARNING: system expat library not found, will use built-in instead
configure: WARNING: Assuming Unix98 printf() is not available,
define HAVE_UNIX98_PRINTF as 1 in setup.h if it is available.
configure: WARNING: Catching fatal exceptions not currently supported on this system, wxApp::OnFatalException will not be called
configure: WARNING: No locale_t support, wxXLocale won't be available
configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: using cross tools not prefixed with host triplet
../src/tiff/libtiff/tif_dirread.c: In function ‘TIFFReadDirEntryDataAndRealloc’:
../src/tiff/libtiff/tif_dirread.c:1230:27: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long int’ [-Wformat=]
 1230 |                           "Failed to allocate memory for %s "
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
 1233 |                           "TIFFReadDirEntryArray", (tmsize_t)1,
      |                                                    ~~~~~~~~~~~
      |                                                    |
      |                                                    long int
In file included from ../src/tiff/libtiff/tiffconf.h:19,
                 from ../src/tiff/libtiff/tif_dirread.c:37:
/usr/share/mingw-w64/include/inttypes.h:52:17: note: format string is defined here
   52 | #define PRId32 "d"
../src/tiff/libtiff/tif_dirread.c:1230:27: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘tmsize_t’ {aka ‘long int’} [-Wformat=]
 1230 |                           "Failed to allocate memory for %s "
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
 1234 |                           already_read + to_read);
      |                           ~~~~~~~~~~~~~~~~~~~~~~
      |                                        |
      |                                        tmsize_t {aka long int}
/usr/share/mingw-w64/include/inttypes.h:52:17: note: format string is defined here
   52 | #define PRId32 "d"
In file included from /usr/share/mingw-w64/include/uiautomation.h:21,
                 from ../src/msw/taskdlg.cpp:46:
/usr/share/mingw-w64/include/uiautomationcoreapi.h:69:128: error: expected ‘,’ or ‘...’ before ‘new’
   69 | HRESULT WINAPI UiaRaiseAutomationPropertyChangedEvent(IRawElementProviderSimple *provider, PROPERTYID id, VARIANT old, VARIANT new);
      |                                                                                                                                ^~~
../src/msw/taskdlg.cpp:121:25: error: ‘IUIAutomationElement’ was not declared in this scope; did you mean ‘LIBID_UIAutomationClient’?
  121 | HWND GetHWNDFromElement(IUIAutomationElement* element)
      |                         ^~~~~~~~~~~~~~~~~~~~
      |                         LIBID_UIAutomationClient
../src/msw/taskdlg.cpp:121:47: error: ‘element’ was not declared in this scope
  121 | HWND GetHWNDFromElement(IUIAutomationElement* element)
      |                                               ^~~~~~~
../src/msw/taskdlg.cpp:135:37: error: ‘IUIAutomationElement’ was not declared in this scope; did you mean ‘LIBID_UIAutomationClient’?
  135 | std::wstring GetCurrentAutomationId(IUIAutomationElement* element)
      |                                     ^~~~~~~~~~~~~~~~~~~~
      |                                     LIBID_UIAutomationClient
../src/msw/taskdlg.cpp:135:59: error: ‘element’ was not declared in this scope
  135 | std::wstring GetCurrentAutomationId(IUIAutomationElement* element)
      |                                                           ^~~~~~~
../src/msw/taskdlg.cpp:136:1: error: expected ‘,’ or ‘;’ before ‘{’ token
  136 | {
      | ^
../src/msw/taskdlg.cpp:221:12: error: ‘IUIAutomation’ does not name a type
  221 |     static IUIAutomation* GetUIAutomation()
      |            ^~~~~~~~~~~~~
../src/msw/taskdlg.cpp:242:21: error: ‘IUIAutomation’ was not declared in this scope
  242 |     static wxCOMPtr<IUIAutomation> ms_uiAutomation;
      |                     ^~~~~~~~~~~~~
../src/msw/taskdlg.cpp:242:34: error: template argument 1 is invalid
  242 |     static wxCOMPtr<IUIAutomation> ms_uiAutomation;
      |                                  ^
../src/msw/taskdlg.cpp: In member function ‘virtual void {anonymous}::wxTaskDialogDarkModule::OnExit()’:
../src/msw/taskdlg.cpp:217:25: error: request for member ‘reset’ in ‘{anonymous}::wxTaskDialogDarkModule::ms_uiAutomation’, which is of non-class type ‘int’
  217 |         ms_uiAutomation.reset();
      |                         ^~~~~
../src/msw/taskdlg.cpp: At global scope:
../src/msw/taskdlg.cpp:249:10: error: ‘IUIAutomation’ was not declared in this scope
  249 | wxCOMPtr<IUIAutomation> wxTaskDialogDarkModule::ms_uiAutomation;
      |          ^~~~~~~~~~~~~
../src/msw/taskdlg.cpp:249:23: error: template argument 1 is invalid
  249 | wxCOMPtr<IUIAutomation> wxTaskDialogDarkModule::ms_uiAutomation;
      |                       ^
../src/msw/taskdlg.cpp: In function ‘void {anonymous}::TDBuildLayoutCache(HWND, std::vector<TDLayoutElement>&)’:
../src/msw/taskdlg.cpp:389:5: error: ‘IUIAutomation’ was not declared in this scope
  389 |     IUIAutomation* const pAuto = wxTaskDialogDarkModule::GetUIAutomation();
      |     ^~~~~~~~~~~~~
../src/msw/taskdlg.cpp:389:20: error: expected primary-expression before ‘const’
  389 |     IUIAutomation* const pAuto = wxTaskDialogDarkModule::GetUIAutomation();
      |                    ^~~~~
../src/msw/taskdlg.cpp:390:11: error: ‘pAuto’ was not declared in this scope
  390 |     if ( !pAuto )
      |           ^~~~~
../src/msw/taskdlg.cpp:393:15: error: ‘IUIAutomationElement’ was not declared in this scope; did you mean ‘LIBID_UIAutomationClient’?
  393 |     wxCOMPtr <IUIAutomationElement> pRoot;
      |               ^~~~~~~~~~~~~~~~~~~~
      |               LIBID_UIAutomationClient
../src/msw/taskdlg.cpp:393:35: error: template argument 1 is invalid
  393 |     wxCOMPtr <IUIAutomationElement> pRoot;
      |                                   ^
In file included from /usr/share/mingw-w64/include/winbase.h:2682,
                 from /usr/share/mingw-w64/include/windows.h:70,
                 from /usr/share/mingw-w64/include/winsock2.h:23,
                 from ../include/wx/msw/wrapwin.h:58,
                 from ../include/wx/msw/wrapcctl.h:13,
                 from ../include/wx/msw/private/taskdlg.h:13,
                 from ../src/msw/taskdlg.cpp:33:
../src/msw/taskdlg.cpp:394:17: error: ‘pAuto’ was not declared in this scope
  394 |     if ( FAILED(pAuto->ElementFromHandle(hwnd, &pRoot)) )
      |                 ^~~~~
../src/msw/taskdlg.cpp:397:14: error: ‘IUIAutomationTreeWalker’ was not declared in this scope
  397 |     wxCOMPtr<IUIAutomationTreeWalker> pWalker;
      |              ^~~~~~~~~~~~~~~~~~~~~~~
../src/msw/taskdlg.cpp:397:37: error: template argument 1 is invalid
  397 |     wxCOMPtr<IUIAutomationTreeWalker> pWalker;
      |                                     ^
../src/msw/taskdlg.cpp:398:5: error: ‘pAuto’ was not declared in this scope
  398 |     pAuto->get_ContentViewWalker(&pWalker);
      |     ^~~~~
../src/msw/taskdlg.cpp:403:12: error: base operand of ‘->’ is not a pointer
  403 |     pWalker->GetFirstChildElement(pRoot, &pChild);
      |            ^~
../src/msw/taskdlg.cpp:408:15: error: base operand of ‘->’ is not a pointer
  408 |         pChild->get_CurrentBoundingRectangle(&info.rect);
      |               ^~
../src/msw/taskdlg.cpp:412:51: error: no match for call to ‘(std::wstring {aka std::__cxx11::basic_string<wchar_t>}) (int&)’
  412 |         info.automationId = GetCurrentAutomationId(pChild);
      |                             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
../src/msw/taskdlg.cpp:415:20: error: base operand of ‘->’ is not a pointer
  415 |         if ( pChild->get_CurrentName(b.Out()) == S_OK && b )
      |                    ^~
../src/msw/taskdlg.cpp:423:34: error: base operand of ‘->’ is not a pointer
  423 |             if ( SUCCEEDED(pChild->GetCurrentPropertyValue
      |                                  ^~
../src/msw/taskdlg.cpp:455:16: error: base operand of ‘->’ is not a pointer
  455 |         pWalker->GetNextSiblingElement(pChild, &pNext);
      |                ^~
../src/msw/taskdlg.cpp: At global scope:
../src/msw/taskdlg.cpp:1073:6: error: variable or field ‘TDApplyToChildren’ declared void
 1073 | void TDApplyToChildren(IUIAutomationElement* pEl)
      |      ^~~~~~~~~~~~~~~~~
../src/msw/taskdlg.cpp:1073:24: error: ‘IUIAutomationElement’ was not declared in this scope; did you mean ‘LIBID_UIAutomationClient’?
 1073 | void TDApplyToChildren(IUIAutomationElement* pEl)
      |                        ^~~~~~~~~~~~~~~~~~~~
      |                        LIBID_UIAutomationClient
../src/msw/taskdlg.cpp:1073:46: error: ‘pEl’ was not declared in this scope
 1073 | void TDApplyToChildren(IUIAutomationElement* pEl)
      |                                              ^~~
../src/msw/taskdlg.cpp: In function ‘BOOL {anonymous}::TDEnumAttachProc(HWND, LPARAM)’:
../src/msw/taskdlg.cpp:1161:5: error: ‘IUIAutomation’ was not declared in this scope
 1161 |     IUIAutomation* const uiAuto = wxTaskDialogDarkModule::GetUIAutomation();
      |     ^~~~~~~~~~~~~
../src/msw/taskdlg.cpp:1161:20: error: expected primary-expression before ‘const’
 1161 |     IUIAutomation* const uiAuto = wxTaskDialogDarkModule::GetUIAutomation();
      |                    ^~~~~
../src/msw/taskdlg.cpp:1162:11: error: ‘uiAuto’ was not declared in this scope; did you mean ‘auto’?
 1162 |     if ( !uiAuto )
      |           ^~~~~~
      |           auto
../src/msw/taskdlg.cpp:1165:14: error: ‘IUIAutomationElement’ was not declared in this scope; did you mean ‘LIBID_UIAutomationClient’?
 1165 |     wxCOMPtr<IUIAutomationElement> pEl;
      |              ^~~~~~~~~~~~~~~~~~~~
      |              LIBID_UIAutomationClient
../src/msw/taskdlg.cpp:1165:34: error: template argument 1 is invalid
 1165 |     wxCOMPtr<IUIAutomationElement> pEl;
      |                                  ^
../src/msw/taskdlg.cpp:1166:17: error: ‘uiAuto’ was not declared in this scope; did you mean ‘auto’?
 1166 |     if ( FAILED(uiAuto->ElementFromHandle(hwndChild, &pEl)) )
      |                 ^~~~~~
../src/msw/taskdlg.cpp:1170:8: error: base operand of ‘->’ is not a pointer
 1170 |     pEl->get_CurrentClassName(cls.Out());
      |        ^~
../src/msw/taskdlg.cpp:1178:51: error: ‘{anonymous}::GetHWNDFromElement’ cannot be used as a function
 1178 |         if ( const HWND hLink = GetHWNDFromElement(pEl) )
      |                                 ~~~~~~~~~~~~~~~~~~^~~~~
../src/msw/taskdlg.cpp:1180:59: error: no match for call to ‘(std::wstring {aka std::__cxx11::basic_string<wchar_t>}) (int&)’
 1180 |             const std::wstring id = GetCurrentAutomationId(pEl);
      |                                     ~~~~~~~~~~~~~~~~~~~~~~^~~~~
../src/msw/taskdlg.cpp:1198:53: error: ‘{anonymous}::GetHWNDFromElement’ cannot be used as a function
 1198 |         if ( const HWND hScroll = GetHWNDFromElement(pEl) )
      |                                   ~~~~~~~~~~~~~~~~~~^~~~~
../src/msw/taskdlg.cpp:1210:41: error: ‘{anonymous}::GetHWNDFromElement’ cannot be used as a function
 1210 |     const HWND hDUI = GetHWNDFromElement(pEl);
      |                       ~~~~~~~~~~~~~~~~~~^~~~~
../src/msw/taskdlg.cpp:1214:5: error: ‘TDApplyToChildren’ was not declared in this scope
 1214 |     TDApplyToChildren(pEl);
      |     ^~~~~~~~~~~~~~~~~
../src/msw/taskdlg.cpp: At global scope:
../src/msw/taskdlg.cpp:1035:1: warning: ‘void {anonymous}::SetWindowSubclassIfNeeded(HWND, SUBCLASSPROC, UINT_PTR)’ defined but not used [-Wunused-function]
 1035 | SetWindowSubclassIfNeeded(HWND hwnd,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~

Vadim Zeitlin

unread,
Jul 9, 2026, 2:43:50 PM (yesterday) Jul 9
to wx-u...@googlegroups.com
On Thu, 9 Jul 2026 10:17:47 -0700 (PDT) Сергей Коныгин wrote:

СК> Everything works fine when compiling for Windows using 32-bit MinGW. A
СК> compilation error occurs when using the cross-compiler (installed on Debian
СК> 12.6). I am configuring wxWidgets using the following lines

What is the version of your cross-compiler and the SDK being used? It
looks like they are somehow not compatible with each other...

СК> Here is a list of errors. What am I doing wrong?
[...unrelated warnings snipped...]
СК> /usr/share/mingw-w64/include/uiautomationcoreapi.h:69:128: error: expected
СК> ‘,’ or ‘...’ before ‘new’
СК> 69 | HRESULT WINAPI
СК> UiaRaiseAutomationPropertyChangedEvent(IRawElementProviderSimple *provider,
СК> PROPERTYID id, VARIANT old, VARIANT new);

This looks like an error in the SDK, "new" is a keyword in C++ and
shouldn't be used as identifier name. I don't have this in my (Debian 13)
version, so it has been already fixed, but we possibly could work around
this by the usual #define-new-as-something-else-before-including-the-header
(and #undef it after) trick. Could you try doing it?

СК> ../src/msw/taskdlg.cpp:121:25: error: ‘IUIAutomationElement’ was not
СК> declared in this scope; did you mean ‘LIBID_UIAutomationClient’?

However if your /usr/share/mingw-w64/include/uiautomationclient.h really
doesn't declare IUIAutomationElement (i.e. it's not some weird consequence
of the error above), there is no chance that this code will compile
anyhow... We're going to need a configure/CMake test and an option to
disable it in this case, please open an issue if this is indeed the case so
that we fix it in 3.3.4/3.4.0.

Thanks,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages