Building MAME using Microsoft Visual Studio compilers

From MAMEDEV Wiki
Revision as of 16:08, 29 March 2016 by Micko (talk | contribs)

By default, MAME is configured via the makefile to build using the MinGW gcc compiler. Although this is a nice cross-platform solution, debugging binaries built this way leaves a lot to be desired.

If you own a copy of Visual Studio, you can configure MAME to build using those tools instead. Once you have done that, you can debug problems in MAME using the Visual Studio debugger, which is a huge step up from gdb.

Here's how to make it work:

  1. You must already have an environment that can build MAME using the MinGW tools. Although you won't be using gcc to compile, you will be using several of the other tools included in the standard MAME MinGW Development Environment
  2. Switch to the directory where the root MAME makefile lives.
  3. Once you've done that, simply run: make vs2015 PYTHON_EXECUTABLE=c:/buildtools/usr/bin/python.exe and wait for it to create projects
  4. In order not to specify PYTHON_EXECUTABLE all the time, just placed it in system variables
  5. For Visual Studio 2013 use: make vs2013
  6. If you are building with XP compatibility enabled run make vs2015_xp or make vs2013_xp
  7. Browse to folder containing solution file and open it with Visual Studio
  8. Inside Visual Studio you can change to Debug/Release x86 or x64 builds
  9. While doing development please note that you need to update LUA files in scripts folders in order to add new sources and regenerate projects
  10. Note that all parameters for partial compilation works so you can do make SUBTARGET=tiny vs2015 or make vs2015 SUBTARGET=drivername SOURCES=src\mame\drivers\drivername.cpp

Back to How MAME Works