Sunday, April 5, 2009

Compiling DosBox (in debug mode) on Ubuntu Jaunty

DosBox, when compiled in heavy debug mode, can be useful to reverse engineer old dos applications, like simple games or viruses (of course, the old dos ones don't replicate on modern windows systems, so there's no harm for anybody).

Compiling DB 0.72 on the current Ubuntu Jaunty release (Beta) causes some errors, first of which is:

gameblaster.cpp => error: ‘memset’ was not declared in this scope

All of them (three in total) can be fixed adding some appropriate includes at the top of the following files:

src/hardware/gameblaster.cpp => #include <string.h>
src/hardware/tandy_sound.cpp => #include <string.h>
src/shell/shell_cmds.cpp => #include <cstdlib>

and this will fix the build. To enable the debug mode (which enables the debugger) now you can compile using:

./configure --enable-debug=heavy

This solution was found in this page:

Howto: Compiling DosBox with Suse 11.0

so he's the person to give credits to!