Skip to content

Conversation

guilt
Copy link

@guilt guilt commented Jun 25, 2025

With minor changes, I was able to get CMake 3.14+GCC 8.1.0 building this package on Windows XP.

TVision-XP

[Update]: On DOS, Borland C++ 3.1 make runs out of memory when trying to build this project. I was able to get it to compile with Borland C++ 4.5 and TASM 4.0, mimicking the setup. Thanks, I'll test this out.

[Update]: Error with textview.cpp is resolved, patch is simpler; I also added -DTV_USE_STATIC_RTL support for GCC; With the toolchain I've given you below, I am able to compile this on Windows 11 and run it on Windows XP as well.
[Update]: The build failure due to ICE on Linux Big Endian machine is flaky as well.

@guilt guilt force-pushed the master branch 4 times, most recently from 6c4f1a3 to 3e96d6a Compare June 25, 2025 06:46
@magiblot
Copy link
Owner

Hi @guilt!

Thank you very much! I already looked into Windows XP support with Visual Studio when discussion #56 was opened, and even though I made sure to choose the Windows XP-compatible toolset, I still couldn't get it to work (despite having sorted out the problem of GetCurrentConsoleFontExand GetTickCount64).

I will take a look into your solution. However, could you share the links to the same versions of GCC and CMake you used?

Cheers.

@guilt
Copy link
Author

guilt commented Jun 25, 2025

This is a 3.14.6 version of CMake - cmake-3.14.6-win32-x86.zip which I had to modify to run on Windows XP (basically, getting back the libcmuv/libcmcurl etc. from 3.13 without the async Windows Vista stuff) and putting it there. For this version, source isn't there (sadly), as I was trying this out to build llama.cpp on XP, ReactOS devs reached out out saying they maintain a newer CMake 3.17 that works on XP as part of their RosBE and so I'd recommend, going forward, we could use that instead.

Version of GCC is 8.1.0, x86, sjlj which you can find archived here - I think I got it from TDM-GCC, which runs fine on XP.

You'd also need the MinGW compatibility C++ headers for this compiler, which you can find here: MinGW-Compat

Preserve default behavior of Windows Vista.
Add Static Linking to GCC as well.
magiblot added a commit that referenced this pull request Aug 22, 2025
…functions not available before Windows Vista

See #180.
magiblot added a commit that referenced this pull request Aug 22, 2025
… WriteConsoleOutputW instead of writing UTF-8 text

This is an issue on Windows XP, where the bitmap font cannot be disabled.
See #180.
@magiblot
Copy link
Owner

Hi @guilt!

Sorry for the late reply. I found the compiler you were using on SourceForge, and for CMake it was enough to use 3.13.5, the last version officially supporting Windows XP.

I thank you again for submitting this pull request, even though I took a different approach which I have already pushed to master.

  • The use of GetTickCount64 can be avoided by using std::chrono instead, as we were already doing on Unix.

  • Instead of using macros to check which version of Windows we are targetting, GetCurrentConsoleFontEx can be simply linked conditionally at runtime.

    By the way, this function is used is to prevent the application from looking like this. The inability to turn off the bitmap font automatically would inevitably lead to some users facing this issue, so it is also necessary to change the way how Turbo Vision draws itself on a legacy console.

  • MSVC's /MT option (turned on when setting TV_USE_STATIC_RTL=ON) is not the same as GCC's -static. The problem arises when linking against Turbo Vision:

    With GCC you can generate a static binary by simply using the -static flag when building the actual application. The user can specify -DCMAKE_CXX_FLAGS=-static for this purpose. With MSVC, however, using /MT in the application requires using /MT in the Turbo Vision library as well. That's why the TV_USE_STATIC_RTL option is provided. In addition, /MT does not prevent you from linking dynamically against other libraries, while -static does.

    So, since these compiler flags actually do different things, I do not feel confident about adding GCC's -static in TV_USE_STATIC_RTL.

Cheers.

@guilt
Copy link
Author

guilt commented Aug 26, 2025

Okay, I saw the changes, they are far more involved and will yield better results for everyone going forward. Were you able to build and test with MSVC or GCC for Windows XP? What version of the compiler did you use?

The idea of using STATIC_* was to ensure that GCC doesn't link against its DLLs (which it does, sadly) and that standalone EXEs can ship directly to older boxes. There was no modern MSVC option I could test on XP, only GCC. This may be the only compiler in that matrix that plays with the option.

Doing it as part of those defines suggested should suffice for most.

If there are alternatives to get this build to happen with MSVC for XP, that would be rad..

This PR is best kept as documentation, and I hope, if anybody requires this, they can refer to the PR. Thank you for making this for XP. I hope you get to test it time to time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants