Cristian Nicolae
Cristian Nicolae

Reputation: 156

Building wxWidgets with WXUNIV=1 fails

I'm trying to compile wxWidgets with the "WXUNIV=1" and it doesn't seem to work on any 3.X.X version. The first version that worked was 2.9.5. Sadly this version is too old to replace the version that I'm using currently (3.1.1).

The steps I'm using to compile are based on https://docs.wxwidgets.org/trunk/plat_msw_install.html.

  1. CD to "wxWidgets-3.1.5\build\msw" with the VS command line and run "nmake /f makefile.vc BUILD=release SHARED=1 TARGET_CPU=X86 WXUNIV=1".

This will give the following error:

D:\wxWidgets-3.1.5\include\wx/msw/chkconf.h(34): fatal error C1189: #error: "wxUSE_WINRT must be defined." NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\cl.EXE"' : return code '0x2' Stop.

  1. Trying to undef wxABORT_ON_CONFIG_ERROR (I know it's not recommended, but it was worth a try) will cause linking errors.

Any idea what might be causing this?

EDIT: I've tried to #define:

wxUSE_WINRT

wxUSE_TASKBARBUTTON

wxUSE_DBGHELP 

a.k.a the defines which were causing errors. This is the same as undef-ing wxABORT_ON_CONFIG_ERROR. I get the following linking errors:

    coredll_graphcmn.obj : error LNK2001: unresolved external symbol "public: static class wxGraphicsRenderer * __cdecl wxGraphicsRenderer::GetDefaultRenderer(void)" (?GetDefaultRenderer@wxGraphicsRenderer@@SAPAV1@XZ)
    coredll_statbmpg.obj : error LNK2001: unresolved external symbol "public: static class wxGraphicsRenderer * __cdecl wxGraphicsRenderer::GetDefaultRenderer(void)" (?GetDefaultRenderer@wxGraphicsRenderer@@SAPAV1@XZ)
    coredll_richtooltipg.obj : error LNK2001: unresolved external symbol "public: static class wxGraphicsRenderer * __cdecl wxGraphicsRenderer::GetDefaultRenderer(void)" (?GetDefaultRenderer@wxGraphicsRenderer@@SAPAV1@XZ)
    coredll_dcgraph.obj : error LNK2001: unresolved external symbol "public: virtual struct HDC__ * __thiscall wxGCDC::AcquireHDC(void)" (?AcquireHDC@wxGCDC@@UAEPAUHDC__@@XZ)
    coredll_dcgraph.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxGCDC::ReleaseHDC(struct HDC__ *)" (?ReleaseHDC@wxGCDC@@UAEXPAUHDC__@@@Z)
    ..\..\lib\vc_dll\wxmswuniv315u_core_vc_custom.dll : fatal error LNK1120: 3 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\link.EXE"' : return code '0x460'

Upvotes: 0

Views: 202

Answers (1)

VZ.
VZ.

Reputation: 22753

wxUniv port is not ready for production use, except in very limited circumstances, so if you're going to use it, especially with something other than X11 backend, you need to be prepared to work on it yourself and, in particular, fix bugs in it.

This one should be quite simple to fix, it's just a missing #if (WinRT and debughlp can be used even with wxUniv, i.e. they depend on platform and not the UI port used, while task bar button should be disabled in wxUniv as it's not implemented there), but it's just the beginning as you'll surely run into more problems later. If you're motivated to work on them, please do, by all means, but I just wanted to warn you that you shouldn't expect this port to be of the same quality as the 3 main ones (MSW/GTK/Mac) or even wxQt.

Upvotes: 0

Related Questions