VOGONS

Common searches


DOSBox Compilation Guides

Topic actions

Reply 40 of 51, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie
junglemontana wrote:

g++ -g -O2 -mno-ms-bitfields -static-libgcc -static-libstdc++ -s -o dosbox.exe dosbox.o winres.o cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/mame/libmame.a hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a -L/mingw32/lib -lmingw32 -lSDLmain -lSDL -mwindows -lncurses -lpng -lz -lSDL_net -lopengl32 -lwinmm -lws2_32

I noticed that on 2019-06-30, ncurses is back for mingw-w64 native code, but it didn't remove PDCurses which was its replacement when it was gone. I did a manual removal of PDCurses to get back to ncurses. My earlier patch is no longer valid. You were actually linking with ncurses while the undefined references were for PDCurses.

You need to pay attention to how your source was configured and if it picked ncurses or PDCurses. Typical, I would prefer ncurses over PDCurses, but I haven't tried my build, since I don't usually need the debugger from DOSBox. I am at r4252, too.

Reply 41 of 51, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Downloading VS2019 community now since I'm at the point of starting to setup the VMs for going back through the guides.

Found the below:

VS2017 w/ 98, NT4 and 2000
https://stackoverflow.com/questions/195 ... 6#53548116
https://tedwvc.wordpress.com/2010/11/07 ... dows-2000/

Investigate <XP on VS2017.
Investigate VS2019 with v141 toolset for XP. v142 Vista+

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 42 of 51, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Possible SDL2 Backports

Although in both cases possibly using a maximized window would be the easiest "fix".

Dual-Monitor
https://www.vogons.org/viewtopic.php?f= ... 69#p782069

Dropped keys
https://www.vogons.org/viewtopic.php?f=31&t=66491

Compilation
https://www.vogons.org/viewtopic.php?f= ... 52#p791089

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 43 of 51, by junglemontana

User metadata
Rank Newbie
Rank
Newbie
kjliew wrote:
junglemontana wrote:

g++ -g -O2 -mno-ms-bitfields -static-libgcc -static-libstdc++ -s -o dosbox.exe dosbox.o winres.o cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/mame/libmame.a hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a -L/mingw32/lib -lmingw32 -lSDLmain -lSDL -mwindows -lncurses -lpng -lz -lSDL_net -lopengl32 -lwinmm -lws2_32

I noticed that on 2019-06-30, ncurses is back for mingw-w64 native code, but it didn't remove PDCurses which was its replacement when it was gone. I did a manual removal of PDCurses to get back to ncurses. My earlier patch is no longer valid. You were actually linking with ncurses while the undefined references were for PDCurses.

You need to pay attention to how your source was configured and if it picked ncurses or PDCurses. Typical, I would prefer ncurses over PDCurses, but I haven't tried my build, since I don't usually need the debugger from DOSBox. I am at r4252, too.

Thanks. I found a solution:

I created a file curses.h in the main include directory of MSYS2/mingw with the following contents

#include "ncurses/curses.h"

and now compiling was successful. Both 32-bit and 64-bit version seem to work well and the debugger appears correctly.

edit: Found a problem! Using Alt+X in the debugger window to set data view to DS:DX doesn't work. It enters an "x" into the debugger command line instead.

Reply 44 of 51, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

VS2017 less than XP
https://stackoverflow.com/questions/195 ... 0/53548116

Attachments

  • Filename
    VS2017forlessthanxp.txt
    File size
    15.58 KiB
    Downloads
    18 downloads
    File license
    Fair use/fair dealing exception

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 45 of 51, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

VS2003 Windows 7+
bytepointer.com/articles/vs7.1_2003_on_ ... al_fix.htm

VS
mkdir c:\dosbox\vcpkg
cd c:\dosbox\vcpkg
git clone https://github.com/Microsoft/vcpkg
bootstrap-vcpkg
vcpkg integrate install
vcpkg install "library"

MT-32
https://www.gog.com/forum/general/dosbo ... lain/post6

C++98 for GCC
C++03 for VS

C++11 would probably bump the minimum VS requirement from VS 2003 to VS2012 or VS2013 and mabye GCC 4.8.1.

No loss of Windows OS compatibility when compiled with mingw w/ GCC but VS would be XP minimum due to the CRT breaking compatibility. Although I'm looking into that viewtopic.php?f=31&t=55706&p=792269&hilit=compilation#p792237

C++ 11 DOSBOX
https://www.vogons.org/viewtopic.php?f= ... 31#p804131

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 46 of 51, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

So I'm spinning this back up again. This weekend I worked on the attached guide for compiling DOSBox with Mingw-w64 6.0.0-3 on Ubuntu 19.10 for compiling executables from NT3.50+, Linux, 32bit and 64bit.

Mingw-w64 still works for compiled executables for NT3.50+ but a commit added in Nov 2017 almost threw me for a loop until I tried some newer msvcrt.dlls. Once these are used then NT3.50+ still work, although officially Mingw-W64 only supports Windows XP+.

I've worked towards making the guide more script-like while also readable.

This current guide has only been tested with Ubuntu 19.10 on a physical machine, I'll need to re-test with WSL and add specific instructions.

Need to work on:
check with clang
Verify that clang mingw-w64 exes only work for Windows 7+. Supposedly less than support dropped a couple of years ago? I don't remember any issues when compiling with MSYS2\Mingw-w64 so likely BS.
Need to add in NT3.50 SDL changes, DOSBox removal of Active Desktop requirement, WSOCK. These were already done previously but haven't re-tested for this guide.
Add info from msys\mingw-w64 guide. Misc troubleshooting, Mingw-w64 builds only for Pentium Pro+. Anything less requires recompiling mingw-w64 (which I plan on working on).
Recompilg mingw-w64 for <Pentium Pro and/or test installing the original mingw. Less than Pentium Pro important for running fDOS games that run too fast and compatibility.

Attachments

Last edited by DosFreak on 2020-01-28, 23:46. Edited 5 times in total.

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 47 of 51, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

I've updated the previous post with a combined Ubuntu and WSL guide. Next is MSYS2 tomorrow.
Also binaries for 32/64bit Linux, 32/64bit Windows for 95 w/Active Desktop and above.

Need to verify dependencies are working.

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 48 of 51, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Added MSYS2 to the guide.

Need to do:
Check SDL_Sound and SDL_NET
Add DOSBox .diff change for SDL so DOSBox while in a window using ddraw or surface gets updated otherwise in window mode the screen is frozen
Test Clang
Verify Clang is Windows XP minimum (2000 with BlackWingCat)
Test original mingw with MSYS2 otherwise need to jump through hoops to update tools in MSYS1 that cause issues when compiling
Original mingw needed for <Pentium Pro until/if I recompile Mingw-W64 to support less than. Also since mingw is readily available whereas a build of Mingw-w64 for <Pentium Pro is not so it's still useful. (Well for those that care about gaming on old computers anyway)

Last edited by DosFreak on 2020-01-25, 22:04. Edited 1 time in total.

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 49 of 51, 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

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 50 of 51, 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.

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline

Reply 51 of 51, 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.

DOSBox Compilation Guides
DosBox Feature Request Thread
PC Game Compatibility List
How To Ask Questions The Smart Way
Running DRM games offline