Error building wxWidgets 3.3.3 on Windows

42 views
Skip to first unread message

Alessandro Bettarini

unread,
Jul 26, 2026, 10:30:44 AM (12 days ago) Jul 26
to wx-users

Windows 11 Pro

Git Bash Shell from
https://git-scm.com/install/windows

C:\Program Files/CMake/bin/cmake.exe -GVisual Studio 18 2026
-D CMAKE_INSTALL_PREFIX=C:/Users/me/bin/wxWidgets-3.3.3
-D CMAKE_CONFIGURATION_TYPES=Debug;Release;RelWithDebInfo
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-D wxBUILD_TOOLKIT=msw
-D wxBUILD_USE_STATIC_RUNTIME=ON
-D CMAKE_MSVC_RUNTIME_LIBRARY:STRING=Multithreaded
-D wxBUILD_SHARED=OFF
-D wxBUILD_MONOLITHIC=ON
-D wxBUILD_SAMPLES=ALL
C:/wxWidgets-3.3.3


-- Which libraries should wxWidgets use?
wxUSE_REGEX: builtin (enable support for wxRegEx class)
wxUSE_ZLIB: builtin (use zlib for LZW compression)
wxUSE_EXPAT: builtin (use expat for XML parsing)
wxUSE_LIBJPEG: builtin (use libjpeg (JPEG file format))
wxUSE_LIBPNG: builtin (use libpng (PNG image format))
wxUSE_LIBTIFF: builtin (use libtiff (TIFF file format))
wxUSE_LIBWEBP: builtin (use libwebp (WebP file format))
wxUSE_NANOSVG: builtin (use NanoSVG for rasterizing SVG)
wxUSE_LUNASVG: OFF (use LunaSVG for rasterizing SVG (C++17
minimum))
wxUSE_LIBLZMA: OFF (use liblzma for LZMA compression)
wxUSE_WEBVIEW: ON (enable wxWebview with Edge, IE)

-- Configured wxWidgets 3.3.3 for Windows
Min OS Version required at runtime: Windows 7 /
Windows Server 2008 (x64 Edition)
Which GUI toolkit should wxWidgets use? msw
Should wxWidgets be compiled into single library? ON
Should wxWidgets be linked as a shared library? OFF
Which wxWidgets API compatibility should be used? 3.2


Open wxWidgets.slnx with Visual Studio 2026, version Insiders [12020.428]

Building the solution terminates wit the following error

Severity:
Error (active)
Code:
E0020
Description:
identifier "wxZipStreamLink" is undefined
Project:
mono
File
C:\wxWidgets-3.3.3\include\wx\zipstrm.h
Line
428

No such error with wxWidgets 3.3.2

If I reconfigure the cmake step to avoid building the samples I can
build the wx libraries.

Alex Bettarini

Vadim Zeitlin

unread,
Jul 26, 2026, 10:37:04 AM (12 days ago) Jul 26
to wx-u...@googlegroups.com
On Sun, 26 Jul 2026 16:30:42 +0200 'Alessandro Bettarini' via wx-users wrote:

AB> Building the solution terminates wit the following error
AB>
AB> Severity:
AB> Error (active)
AB> Code:
AB> E0020

This doesn't look like a build error, Exxxx are intellisense errors that
don't prevent the project from building. Are you sure the project really
hasn't built? If so, there must be another error explaining it.

AB> Description:
AB> identifier "wxZipStreamLink" is undefined
AB> Project:
AB> mono
AB> File
AB> C:\wxWidgets-3.3.3\include\wx\zipstrm.h
AB> Line
AB> 428
AB>

Also, this doesn't show in which source file the problem happens, making
it impossible to say anything more about it.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/

Alessandro Bettarini

unread,
Jul 29, 2026, 11:47:09 AM (9 days ago) Jul 29
to wx-u...@googlegroups.com
It seems to be ok if I configure it with

wxBUILD_MONOLITHIC=OFF

PB

unread,
Jul 29, 2026, 3:06:26 PM (9 days ago) Jul 29
to wx-users
Hi,

I could build wxWidgets 3.3.3 library as static monolithic with static CRT using CMake v4.4.0 and MSVS 2026 v18.8.2 just fine.

Firstly, I ran CMake:
cmake -G "Visual Studio 18 2026" -DwxBUILD_MONOLITHIC=ON -DwxBUILD_SHARED=OFF -DwxBUILD_USE_STATIC_RUNTIME=ON -DwxBUILD_SAMPLES=ALL -S ../wxWidgets-3.3.3 -B .

I then opened the resulting wxWidgets.slnx with MSVS and built it in the default x64 Debug configuration. 

There were two errors but they were in the archive and MFC samples, not the library: 
2>------ Build started: Project: mfc, Configuration: Debug x64 ------ 3>------ Build started: Project: archive, Configuration: Debug x64 ------ 2> mfctest.cpp 2>C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.51.36231\atlmfc\include\afxver_.h(81,2): error C1189: #error: Please use the /MD switch for _AFXDLL builds 2> (compiling source file '../../wxWidgets-3.3.3/samples/mfc/mfctest.cpp') 3>LIBCMTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 3>D:\Dev\Desktop\Lib\wxWidgets-3.3.3-build-vc18_x64_mono-static\lib\vc_x64_lib\archive.exe : fatal error LNK1120: 1 unresolved externals

The MFC sample probably (and understandably) does not like the static CRT linkage. 

The archive sample has linker subsystem set to console but uses  wxIMPLEMENT_APP() instead of  wxIMPLEMENT_APP_CONSOLE().

Regards,
PB

Vadim Zeitlin

unread,
Jul 30, 2026, 6:46:08 AM (8 days ago) Jul 30
to wx-u...@googlegroups.com
On Wed, 29 Jul 2026 12:06:25 -0700 (PDT) PB wrote:

P> The archive sample has linker subsystem set to console but uses
P> wxIMPLEMENT_APP() instead of wxIMPLEMENT_APP_CONSOLE().

If you've already checked that replacing the former with the latter fixes
the monolithic build, could you please make a PR so that I could apply it?

TIA,
Reply all
Reply to author
Forward
0 new messages