Tag Archives: Windows

Upgrading the Windows build chain

Since the very first Windows version of PureBasic (23 years ago), we decided to stick with the built-in MSVCRT.dll to avoid to ship others DLLs along the created PureBasic executables. It allowed to have very small executables (as small as 10 KB) without any dependencies (PureBasic programs never had to enjoy the famous DLL hell which plagued many other programming language at time). Unfortunately, overtime the MSVCRT.dll was becoming older and older because it wasn’t updated by Microsoft which was pushing for using specific DLL from VisualStudio. The side effect of sticking to the old MSVCRT.dll is the added complexity to integrate new third party libraries (like libcurl, sqlite, scintilla and so on) into PureBasic because we can’t access new C functions, or new C++ features. So we had to patch the libs to have them linking properly, was very time consuming to try to emulate new functions with a mix of old functions. We still did this (painful) extra work while we were supporting Windows XP but it’s now going to an end with the PureBasic 6.10 version.

Once XP support was dropped, we could use Visual C++ 2022 (which doesn’t support XP anymore) and started to update the whole build chain. It took a lot of time to update the libraries and to be able to link the MS runtime statically, but it’s finally working ! The good news is we can now use an up-to-date C++ compiler which make our work much more easier and faster (the first new library we are integrating for 6.10 is the WebView one, which requires C++17). The drawback to link statically the MSVC runtime is bigger executables, so smaller one starts in the 150 KB range (still very small anyway by nowadays standards). But there is no DLL dependency, and we could even reduce one DLL dependency by statically linking Scintilla (which wasn’t possible with the old MSVCRT.dll).

So far, so good, we’re all set for the future on Windows and you should enjoy soon faster PureBasic executables (the whole command-set is now recompiled with a better C compiler) and more modern commands, like WebView, coming up faster !