VOGONS

Common searches


DOSBox Compilation Guides

Topic actions

Reply 40 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Alright. Didn't have time to test clang or verify dependencies but I did get mingw working with MSYS2 so that removed all the work of having to update wget,autoconf,automake,pkg-config,gawk,libtool,mercurial,svn,and git and it appears to work fine under MSYS2. I even compiled a DOSBox executable that works on <Pentium Pro.
Check the above post for the update guide.

Need to see about using the original mingw with Ubuntu 19.10 or Ubuntu w/WSL. Should be able to unpack the .deb files from 18.04 but not sure what to do then but I'm sure I'll figure it out.

Bugs with the original Mingw are with FLAC which requires a downgrade to 1.3.2 and SDL_NET. Previously I modified SDL_NET to remove GetLocalAddresses (which introduced the requirement of Active desktop so 1.2.8+ only for 95 and NT4) which isn't used by DOSBox so that will probably work again as well. Depending on what changed though may make more sense to use an older version without that functionality.

So
SDL_NET 1.2.8+ for 95-NT4+ w/Active Desktop
SDL_NET 1.2.7 for 95-NT3.50+ without Active Desktop

How To Ask Questions The Smart Way
Make your games work offline

Reply 41 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Worked on dependencies. Zlib is ridiculous and documented issues with clang.
Looks like the current version of Clang requires Vista+. Need to track down the last XP version. Also need to see if the one I downloaded last year still works for XP.
Need to test clang on Linux.
Need to review old guides and integrate into new one.

How To Ask Questions The Smart Way
Make your games work offline

Reply 42 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Did some testing with clang on Linux and figured out what I needed to do to cross compile with it for Windows but unwind_resume error when compiling DOSBox. Possibly different exception handling between Mingw-w64 and clang. Need to find a clang specifically compiled for Mingw-W64.

Had issues when compiling under my user account that went away under root so recommend using that.
As such I can't use absolute variables and need to use relative so need to switch to that in the guide.
It looks like Zlib in Linux allows you to use ./configure whereas on Windows it doesn't..... It also has CC and CFLAGS hardcoded so have to set those variables. Need to verify if configure can be used in Windows.

How To Ask Questions The Smart Way
Make your games work offline

Reply 43 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Updated guide.

Verified dependencies with MSYS2 w/ original Mingw
Compiled DOSBox SVN for <Pentium Pro for Windows 95/NT4 w/Active Desktop
Still integrating older guides into new one.
Haven't integrated previouis diffs yet so in Window mode use overlay or opengl, Active Desktop still required, Winsock 2 required, Doesn't work on NT3.50 or NT3.51.
For 64bit test march x86-x64 again and replace native.

P.S. Set output to any but surface and window resolution to a percentage for a present from Qbix. 😀 Let the complaining begin! (Works fine on Windows 95 too!)

Attachments

  • Filename
    dosbox.zip
    File size
    1.92 MiB
    Downloads
    233 downloads
    File license
    Fair use/fair dealing exception
Last edited by DosFreak on 2020-02-19, 23:38. Edited 1 time in total.

How To Ask Questions The Smart Way
Make your games work offline

Reply 44 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Updated guide in last post.
Worked on dependencies some more
Switched from native to x86-64
Verified static with clang working.
Dosbox compiled with clang with MSYS results in the console loading but the main dosbox screen not whereas Clang compiled on Linux works. Need to check.
Fixed zlib makefile by adding a variable. Currently two makefiles 1 for 32bit and 1 for 64bit for windows. Now can easily use gcc or clang for zlib.
Standardized make with nproc variable.
Renamed misnamed variables.

How To Ask Questions The Smart Way
Make your games work offline

Reply 46 of 60, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

MSYS2/mingw-w64 dropped Windows XP support, not just the toolchain environment but including native binaries produced by the GNU GCC compilers.
The main culprit is winpthread library. The upstream targeted Window 7 APIs as minumum requirement.
https://github.com/msys2/MINGW-packages/issues/5139#

Everyone just wishes/wants/likes legacy Windows killed .....

Reply 47 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

DOSBox binary works fine on 95+, NT3.50+ if compiled static when compiled with MINGW-W64 that was compiled with win32 instead of posix thread. Mingw-W64 from the MSYS2 repo is compiled with posix instead of win32 thread and they are too lazy to provide both but you can download a older non-trunk win32 build from their site that is or compile under Ubuntu WSL or regular Ubuntu since their Mingw-w64 is compiled with win32 thread.

RL got in the way again for the past two weeks but the next project will be to compile MSYS2 / MinGW-W64 for i686+ and <i686 for win32 on Windows and <i686 on Linux, sadly I'll still need to provide the current instructions for those too lazy to compile the toolchain themselves but will be useful for those who care.

Dealing with MSYS2 w/ MINGW-W64 oddities is a pain and compiling is sooooo slow, I'm really not sure why anyone would bother with it now that WSL has caught up for those who don't want to use Vmware. Mabye those with blinding hatred for Windows 10 so insist on using MSYS2/Mingw-W64 on <10? if so switch to Linux and compile from there.

A commit posted last year concerned dropping of Windows 2000 support due to them requiring a newer MSVCRT. So the MINGW-W64 devs are well aware of OS support, AFAIK Windows XP is still supported by MINGW-W64 but they can't do anything about 3rd party libraries. Currently the MSVCRT issue isn't a concern for 2000 and below as long as the MSVCRT is updated on those systems otherwise you'd have to compile with an older version of Mingw-w64.

TLDR, likely a combination of using win32 thread and compiling statically which allows DOSBox to continue functioning on older operating systems when using MINGW-W64. Since dosbox doesn't contain C++11 \C++11 thread code then the winpthread addition added by Mingw-w64 compiled with posix is an unnecessary requirement.

I do wonder if it was used which would be better winpthread or https://github.com/meganz/mingw-std-threads ?

Last edited by DosFreak on 2020-02-20, 00:39. Edited 9 times in total.

How To Ask Questions The Smart Way
Make your games work offline

Reply 48 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Minor update.

Changed LIBSSDLS variables -lsdl_net to -lSDL_net for Linux.
Need to check zlib on Linux again. Possibly variables messing up.

Verified again that a compiled DOSBox executable with Mingw-w64 w/gcc 9.2 win32 compiled on Linux works on Windows XP.

Attachments

How To Ask Questions The Smart Way
Make your games work offline

Reply 49 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

For those using the v141 toolset and compiling a binary compatible with Windows XP be aware that the 2015-2019 VC++ redist newer than 14.28.29213.0 doesn't work on XP vanilla so use a redist <= that version or don't compile DOSBox with newer versions of VS if you want to run it on XP 😀.

How To Ask Questions The Smart Way
Make your games work offline

Reply 50 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Investigate if needed if compiling using Posix and Windows XP

wget http://repo.msys2.org/mingw/i686/mingw-w64-i6 … -any.pkg.tar.xz
wget http://repo.msys2.org/mingw/i686/mingw-w64-i6 … -any.pkg.tar.xz

pacman -U --noconfirm mingw-w64-i686-libwinpthread-git-7.0.0.5273.3e5acf5d-1-any.pkg.tar.xz mingw-w64-i686-winpthreads-git-7.0.0.5273.3e5acf5d-1-any.pkg.tar.xz

rm mingw-w64-i686-libwinpthread-git-7.0.0.5273.3e5acf5d-1-any.pkg.tar.xz
rm mingw-w64-i686-winpthreads-git-7.0.0.5273.3e5acf5d-1-any.pkg.tar.xz

How To Ask Questions The Smart Way
Make your games work offline

Reply 51 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Attached is a dosbox build compiled 10-9-2021 using Ubuntu 20.04.3 and Mingw-w64 cross compilation to windows using:
gcc Thread model: win32
gcc version 9.3-win32 20200320 (GCC)
and static dependencies

As you can see it runs fine on Windows XP
and even Windows ME with MSVCRT 7.0.9981.0 (I haven't made the usual SDL or DOSBox changes for this quick build so expect display and mouses issues with 9x (bug introduced in 1.2.14 with switch to dinput) and of course Active Desktop is required).
😀

Attachments

  • Filename
    dosbox 11-1-2021.zip
    File size
    1.78 MiB
    Downloads
    137 downloads
    File license
    Fair use/fair dealing exception

How To Ask Questions The Smart Way
Make your games work offline

Reply 52 of 60, by Wengier

User metadata
Rank Member
Rank
Member
DosFreak wrote on 2021-11-02, 01:00:
Investigate if needed if compiling using Posix and Windows XP […]
Show full quote

Investigate if needed if compiling using Posix and Windows XP

wget http://repo.msys2.org/mingw/i686/mingw-w64-i6 … -any.pkg.tar.xz
wget http://repo.msys2.org/mingw/i686/mingw-w64-i6 … -any.pkg.tar.xz

pacman -U --noconfirm mingw-w64-i686-libwinpthread-git-7.0.0.5273.3e5acf5d-1-any.pkg.tar.xz mingw-w64-i686-winpthreads-git-7.0.0.5273.3e5acf5d-1-any.pkg.tar.xz

rm mingw-w64-i686-libwinpthread-git-7.0.0.5273.3e5acf5d-1-any.pkg.tar.xz
rm mingw-w64-i686-winpthreads-git-7.0.0.5273.3e5acf5d-1-any.pkg.tar.xz

The download links for (lib)winpthread-git appear to be dead. You may want to attach them here.

Reply 53 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

I just use a win32 thread compiled mingw-w64 instead of posix thread. No issues there and can compile for NT 3.5x, 9x+. *Just need to update msvcrt.dll to latest for <=2000.
It's funny that they break posix thread for Windows XP while every other Windows OS works fine after. Of course they plan on breaking 7 and 8 next year. It's wonderful when open source follows the obsolesence plans of big tech but that's who's running it now so makes sense. Windows 7/2008R2 ESU doesn't end until Jan 2023.....

https://github.com/msys2/MSYS2-packages/issues/2696

For those who want to use posix thread then would likely need to:

Option 1
Find a repo/mirror containing older compiled mingw-w64 packages equal to or older than Dec 2018?
The ones from the links above were created on Dec 4 2018 (Archive.org didn't archive this one either) : https://web.archive.org/web/20200217203736/ht … org/mingw/i686/

Option 2
Download the source and those two packages before this commit? According to some comments using the latest version of mingw-w64 (at the times) with just those 2 packages downgraded resulted in pthread XP compatibility.
https://github.com/msys2/MINGW-packages/commi … 0affb372b8d5e29
https://github.com/msys2/MSYS2-packages/commi … d90e2edf21bbe7f
Also look at: https://sourceforge.net/p/mingw-w64/mingw-w64 … cd420997b64b08/

Option 3
For those using MSYS2 w/mingw-w64 then this should work:
https://sourceforge.net/projects/mingw-w64/fi … ds-posix/dwarf/

Option 3
For those cross compiling from Linux then look into using an older version of Linux and either pull from repo or check offline dvd packages that come with distro or see what repos those older versions of Linux use and pull those packages for use on the latest version of Linux

Note that for those using pacman or vcpkg to pull down precompiled libraries the the possibility of them being compiled with mingw-w64 w/posix thread is high so would need to recompile with the working compiler. Also the last time I bothered to use MSYS2 even when using a win32 mingw-w64 it still pulled down posix pacman packages so you're better off cross compiling from linux where mingw-w64 is still win32 thread.

How To Ask Questions The Smart Way
Make your games work offline

Reply 55 of 60, by stanwebber

User metadata
Rank Member
Rank
Member

i have spent the last several days following these instructions and have produced multiple working builds (xp+), but i see no possible way of generating anything that works under win9x as claimed in the guide.

i have built my own mingw environment as well as used the provided 'ready to compile' archive on google drive. the result is the same using the instructions: gcc 6.3.0 that produces builds requiring versions of msvcrt in winxp & higher.

as it exists now, the mingw win9x guide is a collosal waste of time. there are easier ways to build dosbox for winxp.

Reply 56 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Start with compiling a hello world to verify your environment is correct.

Post the error you are receiving, typically for msvcrt it should show a decent error message.

Regular mingw can build working executables for the msvcrt that comes with 9x but for mingw-w64 (win32 thread) you'll need to use a newer msvcrt.dll than the one provided with 9x.

As long as you use Q932590 (rename MV6.dll to msvcrt.dll and replace the existing msvcrt.dll) then you are good for 95+ and NT3.50+. This verion is 6.1.9848.0.
MSVCR70.dll v7.0.9981.0 should work as well.
MSVCRT.DLL v7.0.3790.4341 from "WindowsServer2003-KB955536-x86-ENU" may work as well if you want an original msvcrt.dll instead of msvcr70.

For these guides I'd like to get them functional via a repo on github but never received much feedback on the DOSBox guides nor downloads, and the attitude I get when I bring up running software on older operating systems puts me off which is why more hasn't been done with it, currently focused on going through the yearly making offline working versions of online stores games which also involves identifying ports for games and their compatibility here: https://github.com/vogonsorg/

Attachments

  • Filename
    Q932590.zip
    File size
    206.91 KiB
    Downloads
    72 downloads
    File license
    Fair use/fair dealing exception

How To Ask Questions The Smart Way
Make your games work offline

Reply 57 of 60, by stanwebber

User metadata
Rank Member
Rank
Member

that's exactly my complaint: i used regular mingw and everything it builds with gcc 6.3.0 refuses to run under win9x. the dosbox nt/95/98 binary examples you provide in the releases folder (dated 5-2-18) all work BEAUTIFULLY so what gives!? i get this 'The DOSBOX.EXE file is liked to missing export MSVCRT.DLL:_fstat64' error with everything i compile.

truth be told i struggled for hours upon hours building my own environment and i did eventually (with deviations from your guide) get everything to compile without errors, but here's the deal: once i wiped my own mingw build and completely replaced it with your 'ready to compile' archive everything in the instructions fell into place. i followed your guide to the letter and didn't have a single hiccup or have to alter any files or commands. the ONLY deviation i made was not patching sdl with the diff dosbox provides. at the end of perfect error-free runs i still got binaries with the exact same msvcrt error.

btw, the Q932590.zip file you just attached makes this post the only location in the entirety of the internet where you can get that file now. i spent an hour on archive.org looking thru old cached webpages trying to find it and came up empty.

also, your google drive is now the only place on the internet to find precompiled win32 binaries of the version of gawk you used. i struggled to compile it from source only to find it later while combing thru your drive.

Reply 58 of 60, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Yeah you'll need to use a newer MSVCRT, see:
Re: Quake equivalent of Hammer of Thyrion

It's possible I only tested with a newer MSVCRT when I used a newer MinGW version but I also want to say I did mention the MSVCRT in the guide but I'll have to check.

If it's true that newer versions of MINGW require "_fstat64" then would be interesting to track down when it was required, the developer can be contacted and still submits patches for it but really that newer MSVCRT is preferred for NT3.50+,95,98,ME,2000 to get programs to work that were compiled with newer compilers.

The default mingw/MSYS environment is extremely old. A lot of the tools included with it to are so ancient and buggy I wasn't able to compile DOSBox properly (mostly due to using newer versions of dependencies required by DOSBox, DOSBox itself was fine) The environment I put together had a lot of the tools manually replaced so DOSBox could compile.

This is why I uploaded it since it was a PITA to figure it out.

In a later guide (can't remember if I posted it or not) I moved on and moved the mingw (original mingw) environment into MSYS2 which was a lot better. MSYS2 while better than MSYS1 is still poor compared to WSL or Linux which is why I prefer those.

Ideally I would have gotten around to recompiling MinGW-W64 to support less than Pentium Pro so MinGW could potentially be dropped but never got around to it.

I agree things could be alot better as far as these environments. Developers should at a minimum state what operating systems they support and ideally what operating systems their compilers and programs work on. When they end support they should release a final version for that OS and if not offer the last working version. Sadly laziness prevails. For vogons I'm attempting to do so with vogonsorg on github so at least the users here know what versions work and if we want work on getting newer versions working.

How To Ask Questions The Smart Way
Make your games work offline

Reply 59 of 60, by stanwebber

User metadata
Rank Member
Rank
Member

so then you didn't actually compile:
/Windows/Releases/Mingw/.5-2-2018/i386+/dosbox95x32.exe

/Windows/Releases/Mingw/5-2-2018/i386+/dosbox351x32.exe

/Windows/Releases/Mingw/5-2-2018/i386+/dosboxNT4x32.exe

/Windows/Releases/Mingw/5-2-2018/i386+/dosboxx32.exe
in your own build environment? where did you get these files?