MULTI-TARGETING VISUAL STUDIO DOSBOX GUIDE DOSBox System Requirements Minimum CPU:i586 (Pentium) OS: 95,NT3.51,NT4 Memory: 128MB Video Card: 16bit color DirectX (95): DX7+ with ddraw acceleration OpenGL (95,NT4): OpenGL 1.2 compliant video card Recommended: CPU:i686 (Pentium Pro+) OS: 98+,2000+ Memory: 256MB Video Card: 16bit color, DX7+ compatible DirectX (98+,2000+): DX7+ with ddraw acceleration OpenGL (98+,2000+): OpenGL 1.2 compliant video card PREREQUISITES COMPRESSION 7-zip FILE EDITING Notepad++ LEGACYEXTENDER (To compile for NT3.51-95-98-NT4 on VS2008) http://www.legacyextender.com/ IDE -VS2017 for XP+ (i686) -VS2008 w/ legacyextender for NT3.51-2000 (i586+) Microsoft Visual Studio 2017 v15.3.3 (Windows 10 x64 v1703) Microsoft Visual Studio 2008 v9.0.21022.8 (Windows 10 x64 v1703) IDE ADDON Daffodil https://daffodil.codeplex.com/ DOSBOX SOURCE http://source.dosbox.com/dosboxsvn.tgz SDL https://www.libsdl.org/release/?C=N;O=A SDL-1.2.15.zip DIRECTX SDK DXSDK_feb10.exe https://www.microsoft.com/en-us/download/details.aspx?id=10084 DXSDK_jun10.exe from: (DDRAW.H is DEPRECATED) https://www.microsoft.com/en-us/download/details.aspx?id=6812 OR https://www.vogons.org/viewtopic.php?f=31&t=55706&p=614650#p614650 Download DXSDKFebJune2010forSDL1.2.x.zip You only need the following files from the DirectX SDK: INCLUDE ddraw.h dinput.h dsound.h LIB ddraw.lib dinput8.lib dsound.lib OPTIONAL LIBRARIES SDL_NET http://www.libsdl.org/projects/SDL_net/release/ SDL_net-1.2.8.zip libpng https://sourceforge.net/projects/libpng/files/libpng16/ lpng1632.zip zlib https://zlib.net/fossils/?C=M;O=D zlib-1.2.11.tar.gz LIBOGG http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz LIBVORBIS http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz FLAC https://ftp.osuosl.org/pub/xiph/releases/flac/?C=M;O=A flac-1.3.1.tar.xz SDL_SOUND https://www.icculus.org/SDL_sound/downloads/SDL_sound-1.0.3.tar.gz NASM http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/win32/ nasm_2.13.01-install-x86.exe INSTALL SOFTWARE 1. Install the following software: Visual Studio 2008 Visual Studio 2017 (Check Windows Universal CRT SDK and Windows XP Support for C++ in setup) Daffodil DirectX SDK February 2010 DirectX SDK June 2010 7-zip Notepad++ NASM Add "C:\Program Files (x86)\NASM" to system environment variables. (REQUIRED FOR FLAC) SETUP FOLDER STRUCTURE 1. Create the following directory structure: C:\Build\DOSBOX\multi\VS2017\XP C:\Build\DOSBOX\multi\VS2017\Vista+ C:\Build\DOSBOX\multi\VS2008\98-2000 C:\Build\DOSBOX\multi\VS2008\95-NT4AD C:\Build\DOSBOX\multi\VS2008\95-NT4 C:\Build\DOSBOX\multi\VS2008\3.51 C:\Build\DOSBOX\multi\VS2008\3.50 2. Create "DOWNLOAD" and "COMPILE" folders in each subfolder. 3. Copy all downloaded prerequisites into each "DOWNLOAD" folder. DXSDK_Jun10.exe (Only to VS2008\98-2000,VS2008\95-NT4AD,VS2008\95-NT4,VS2017\XP) DXSDK_Feb10 (Only to VS2008\98-2000,VS2008\95-NT4AD,VS2008\95-NT4,VS2017\XP) LegacyExtender (Only to VS2008\XX\DOWNLOAD) 4. (Only for VS2008\98-2000,VS2008\95-NT4AD,VS2008\95-NT4,VS2017\XP) a. Create a DXLEGACY folder under each \COMPILE folder. b. Copy "Include" and "Lib" folders from the "DirectX SDK June 2010" C:\Program Files (x86)\Microsoft DirectX SDK (June 2010) to the DXLEGACY folder. c. Copy "dvp.h" and "ddraw.h" from the DirectX SDK February 2010" INCLUDE folder C:\Program Files (x86)\Microsoft DirectX SDK (February 2010) to the same folder under the DXLEGACY folder. d. Copy "ddraw.lib" from the DirectX SDK February 2010" lib x86 and x64 folders C:\Program Files (x86)\Microsoft DirectX SDK (February 2010) to the same folders under the DXLEGACY folder. 5. Uncompress the below prerequisites to each "COMPILE" folder. dosboxsvn lpng1632 SDL_net-1.2.8 SDL-1.2.15 zlib-1.2.11 (Rename to ZLIB) LegacyExtender (Only to the VS2008 folder structure) LIBOGG LIBVORBIS FLAC SDL_SOUND COMPILE LIBPNG AND ZLIB 1. a. Go here: C:\Build\DOSBOX\lpng1632\projects\visualc71\libpng and open "libpng.sln" with Visual Studio. b. If Visual Studio asks you to retarget or "upgrade" then choose "OK". c. Wait for Visual Studio to to finish. d. In Solution Explorer right-click "Solution" and select properties. Choose "Multiple Startup Projects" and set "libpng" and "zlib" to "Start" e. Press "Apply" and then "OK". 2. a. Right-click "Solution" in "Solution Explorer" and choose "Configuration Manager" b. In "Active solution configuration" choose "LIB Release" c. Verify "libpng","pnglibconfig" (if availabe) and "zlib" are set to "Release", "Release Library" or "LIB Release" if not then change them to that. d. For all other items uncheck "Build". e. Click "OK" or "Close". 3. a. In Solution Explorer right-click "libpng" and select "properties". b. Verify that "Configuration Type" in the "Libpng Property Pages" box is set to "Static library (.lib)" 2000 AND BELOW c. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP c. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ c. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" d. Click "VC++ Directories" e. Click on "Include Directories", select the down arrow to the right and choose edit, Click folder with an asterix and add the zlib folder. C:\Build\DOSBOX\multi\VSXXXX\XXXX\COMPILE\zlib f. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) g. Click "OK" 4. a. In Solution Explorer right-click "zlib" and select "properties". b. Verify that "Configuration Type" in the "Libpng Property Pages" box is set to "Static library (.lib)" 2000 AND BELOW c. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP c. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ c. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" d. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) e. Click "OK" 5. Compile the project and go here to view your .lib files "C:\Build\DOSBOX\multi\VSXXXX\XXXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release" COMPILE SDL 1. Go to "C:\Build\DOSBOX\multi\VSXXXX\XXXX\COMPILE\SDL-1.2.15\VisualC" and open "SDL.sln" with VS. If Visual Studio wants to upgrade the project then let it. 2. Right-click "Solution 'SDL" and select "Configuration Manager". Set "Active solution configuration" to "Release". Verify "SDL" and "SDLmain" are set to "Release" and checked. 3. In Solution Explorer right-click SDL and select properties. a. Go to "General"->"Configuration Type" and set to "Static library (.lib)" **If you want to keep SDL.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" 2000 AND BELOW c. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP c. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ c. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" **If you want to keep SDL.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" WINDOWS XP AND BELOW. IF WINDOWS VISTA+ THEN SKIP THIS STEP a. Click on "VC++ Directories" and update "Include directories" by adding: "C:\BUILD\DOSBOX\DXLEGACY\Include" b. Click on "Library Directories" and update to add: "C:\BUILD\DOSBOX\DXLEGACY\Lib\x86" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. In Solution Explorer right-click SDLmain and select properties. a. Go to "General"->"Configuration Type" and set to "Static library (.lib)" 2000 AND BELOW b. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP b. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ b. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" c. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 6. In Solution Explorer expand "SDL" and go to SDL_dx5video.c a. Right-click SDL_dx5video.c and select "view code". b. Go to line 1516 and change "#if 0" to "#if 1". This change is required for DDRAW to work. #if 1 /* FIXME: enable this when SDL consistently reports lost surfaces */ if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { video->flags |= SDL_HWSURFACE; } else { video->flags |= SDL_SWSURFACE; } 7. Compile! 8. Check C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\Release C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release COMPILE SDL_NET 1. Go to "C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_net-1.2.8\VisualC", unzip Visualc.zip and open SDL_net_VS2008.sln. Upgrade if prompted. 2. Right-click "Solution 'SDL_net'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "SDL_net" is set to "Release" and that "Build" is checked and then click "Close". Uncheck "Showinterfaces" if shown. 3. Right-click "sdl_net" and select properties. a. Set "Configuration Type" to Static Library (.lib) 2000 AND BELOW b. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP b. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ b. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" **If you want to keep SDL_net.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" c. Select "VC++ directories" then "Include Directories" and add the following directory: C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\include d. Click on "Library Directories" and update to add: C:\Build\DOSBOX\multi\XXXX\xXXX\COMPILE\SDL-1.2.15\VisualC\Release C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release e. Click "Apply" and then "OK" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Go to sdlnet.c and comment out Lines 163-237 as follows. If you don't then you'll get an error when you try to compile DOSBOX. DOSBOX doesn't use this function anyway: ERROR: "1>sdl_net.lib(SDLnet.obj) : error LNK2019: unresolved external symbol _GetAdaptersInfo@8 referenced in function _SDLNet_GetLocalAddresses 1>.\Release/dosbox.exe : fatal error LNK1120: 1 unresolved externals" /* int SDLNet_GetLocalAddresses(IPaddress *addresses, int maxcount) { int count = 0; #ifdef SIOCGIFCONF #ifndef _SIZEOF_ADDR_IFREQ #define _SIZEOF_ADDR_IFREQ sizeof #endif SOCKET sock; struct ifconf conf; char data[4096]; struct ifreq *ifr; struct sockaddr_in *sock_addr; sock = socket(AF_INET, SOCK_DGRAM, 0); if ( sock == INVALID_SOCKET ) { return 0; } conf.ifc_len = sizeof(data); conf.ifc_buf = (caddr_t) data; if ( ioctl(sock, SIOCGIFCONF, &conf) < 0 ) { closesocket(sock); return 0; } ifr = (struct ifreq*)data; while ((char*)ifr < data+conf.ifc_len) { if (ifr->ifr_addr.sa_family == AF_INET) { if (count < maxcount) { sock_addr = (struct sockaddr_in*)&ifr->ifr_addr; addresses[count].host = sock_addr->sin_addr.s_addr; addresses[count].port = sock_addr->sin_port; } ++count; } ifr = (struct ifreq*)((char*)ifr + _SIZEOF_ADDR_IFREQ(*ifr)); } closesocket(sock); #elif defined(__WIN32__) PIP_ADAPTER_INFO pAdapterInfo; PIP_ADAPTER_INFO pAdapter; PIP_ADDR_STRING pAddress; DWORD dwRetVal = 0; ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO); pAdapterInfo = (IP_ADAPTER_INFO *) SDL_malloc(sizeof (IP_ADAPTER_INFO)); if (pAdapterInfo == NULL) { return 0; } if ((dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen)) == ERROR_BUFFER_OVERFLOW) { pAdapterInfo = (IP_ADAPTER_INFO *) SDL_realloc(pAdapterInfo, ulOutBufLen); if (pAdapterInfo == NULL) { return 0; } dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen); } if (dwRetVal == NO_ERROR) { for (pAdapter = pAdapterInfo; pAdapter; pAdapter = pAdapter->Next) { for (pAddress = &pAdapterInfo->IpAddressList; pAddress; pAddress = pAddress->Next) { if (count < maxcount) { addresses[count].host = inet_addr(pAddress->IpAddress.String); addresses[count].port = 0; } ++count; } } } SDL_free(pAdapterInfo); #endif return count; }*/ 6 Compile! 7. Check C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_net-1.2.8\VisualC\Release COMPILE LIBOGG 1. Go to "C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libogg-1.3.2\win32\VSXXXX" and open the "static" .sln file. Upgrade if prompted. 2. Right-click "Solution 'libogg_static'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "libogg_static" is set to "Release" and that "Build" is checked and then click "Close". 3. Right-click "libogg_static" and select properties. a. Set "Configuration Type" to Static Library (.lib) 2000 AND BELOW b. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP b. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ b. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" **If you want to keep SDL_net.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Compile! 6. Check C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libogg-1.3.2\win32\VSXXXX\Win32\Release COMPILE LIBVORBIS 1. Go to "C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libvorbis-1.3.5\win32\VSXXXX" and open the "static" .sln file. Upgrade if prompted. 2. Right-click "Solution 'vorbis_static'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "vorbis_static,libvorbisfile" are set to "Release" and that "Build" is checked and then click "Close". 3. Right-click each "vorbis_static,libvorbisfile"and select properties. a. Set "Configuration Type" to Static Library (.lib) 2000 AND BELOW b. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP b. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ b. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" **If you want to keep SDL_net.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" c. Select "VC++ directories" then "Include Directories" and add the following directory: C:\Build\DOSBOX\multi\VSXXXX\XXXX\COMPILE\libogg\include\ogg e. Click "Apply" and then "OK" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Compile! 6. Check C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libvorbis-1.3.5\win32\VSXXXX\Win32\Release COMPILE FLAC 1. Go to "C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\flac-1.3.1" and open the "flac.sln" file. Upgrade if prompted. 2. Right-click "Solution 'FLAC'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "libFLAC_dynamic, libFLAC_static" are set to "Release" and that "Build" is checked and then click "Close". 3. Right-click each "libFLAC_dynamic, libFLAC_static"and select properties. a. Set "Configuration Type" to Static Library (.lib) 2000 AND BELOW b. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP b. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ b. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" **If you want to keep SDL_net.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" c. Copy C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libogg\include\ogg to C:\Build\DOSBOX\multi\VS2017\XP\COMPILE\flac-1.3.1\include\ogg e. Click "Apply" and then "OK" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Compile! 6. Check C:\Build\DOSBOX\multi\XXXX\XX\COMPILE\flac-1.3.1\objs\release\lib COMPILE SDL_SOUND 1. Go to "C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_sound-1.0.3\VisualC" and open the "sdl_sound.dsw" file. Upgrade if prompted. 2. Right-click "Solution 'sdl_sound'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "sdl_sound_dll,sdl_sound_static" are set to "Release" and that "Build" is checked and then click "Close". 3. Right-click "sdl_sound_dll,sdl_sound_static" and select properties. a. Set "Configuration Type" to Static Library (.lib) 2000 AND BELOW b. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP b. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ b. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" **If you want to keep SDL_net.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" c. Select "VC++ directories" then "Include Directories" and add the following directory: C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\include C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\flac-1.3.1\include C:\Build\DOSBOX\multi\VS2017\XP\COMPILE\libvorbis-1.3.5\include e. Click "Apply" and then "OK" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Compile! 6. Check C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_sound-1.0.3\VisualC\win32lib In SDL_sound.c Remove: #if (defined SOUND_SUPPORTS_MIKMOD) extern const Sound_DecoderFunctions __Sound_DecoderFunctions_MIKMOD; #endif #if (defined SOUND_SUPPORTS_MODPLUG) extern const Sound_DecoderFunctions __Sound_DecoderFunctions_MODPLUG; #endif #if (defined SOUND_SUPPORTS_MODPLUG) { 0, &__Sound_DecoderFunctions_MODPLUG }, #endif #if (defined SOUND_SUPPORTS_MIKMOD) { 0, &__Sound_DecoderFunctions_MIKMOD }, #endif Delete decoders\mikmod.c from both projects Delete decoders\modplug.c from both projects. Delete decoders\smpeg.c from both projects COMPILE DOSBOX 1. Go to C:\Build\DOSBOX\multi\VSXXXX\XXXX\COMPILE\dosbox\visualc_net and click on dosbox.sln and upgrade if prompted. 2. In Solution Explorer right-click "Solution 'dosbox" and select "Configuration Manager". Set "Active solution configuration to "Release". Verify that "dosbox" is set to "Release" and checked. 3. In Solution Explorer right-click dosbox and select properties. GENERAL 2000 AND BELOW b. Verify that "Platform Toolset" is set to "Visual Studio 2008 (v90)" XP b. Verify that "Platform Toolset" is set to "Visual Studio 2017 - Windows XP (v141_xp)" VISTA+ b. Verify that "Platform Toolset" is set to "Visual Studio 2017 (v141)" VC++ DIRECTORIES XP AND BELOW a. Select "VC++ Directories" and then "Include Directories". b. Add the following directories: C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\lpng1632 C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_net-1.2.8 C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\include C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\zlib C:\BUILD\DOSBOX\DXLEGACY\Include C:\Build\DOSBOX\multi\\XXXX\XXXX\\COMPILE\SDL_sound-1.0.3 C:\Build\DOSBOX\multi\\XXXX\XXXX\\COMPILE\flac-1.3.1 C:\Build\DOSBOX\multi\\XXXX\XXXX\\COMPILE\libogg C:\Build\DOSBOX\multi\\XXXX\XXXX\\COMPILE\libvorbis OR C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libvorbis;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libogg;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\flac-1.3.1;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_sound;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\DXLEGACY\Include;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\zlib;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\include;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_net-1.2.8-fixed;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\lpng1632; c. Select "Library Directories" and add the following directories: C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\Release C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release\ZLib C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_net-1.2.8-fixed\VisualC\Release C:\BUILD\DOSBOX\DXLEGACY\Lib\x86 C:\Build\DOSBOX\multi\\XXXX\XXXX\\COMPILE\SDL_sound\VisualC\sdl_sound_static___Win32_Debug C:\Build\DOSBOX\multi\\XXXX\XXXX\\COMPILE\flac-1.3.1\objs\release\lib C:\Build\DOSBOX\multi\\XXXX\XXXX\\COMPILE\libogg\win32\VS2010\Win32\Release C:\Build\DOSBOX\multi\\XXXX\XXXX\\COMPILE\libvorbis\win32\VS2010\Win32\Release OR C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\legacyextender;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libvorbis\win32\VS2010\Win32\Release;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\libogg\win32\VS2010\Win32\Release;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\flac-1.3.1\objs\release\lib;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_sound\VisualC\sdl_sound_static___Win32_Debug;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\DXLEGACY\Lib\x86;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_net-1.2.8-fixed\VisualC\Release;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release\ZLib;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\Release; VISTA+ a. Select "VC++ Directories" and then "Include Directories". b. Add the following directories: C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\lpng1632 C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL_net-1.2.8 C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL-1.2.15\include C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\zlib C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL_sound C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\flac-1.3.1 C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\libogg C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\libvorbis OR C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\libvorbis;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\libogg;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\flac-1.3.1;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL_sound;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\zlib;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL_net-1.2.8-fixed;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL-1.2.15\include;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\lpng1632; c. Select "Library Directories" and add the following directories: C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL-1.2.15\VisualC\Release C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release\ZLib C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL_net-1.2.8\VisualC\Release C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL_sound\VisualC\sdl_sound_static___Win32_Debug C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\flac-1.3.1\objs\release\lib C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\libogg\win32\VS2010\Win32\Release C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\libvorbis\win32\VS2010\Win32\Release OR C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\libvorbis\win32\VS2010\Win32\Release;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\libogg\win32\VS2010\Win32\Release;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\flac-1.3.1\objs\release\lib;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL_sound\VisualC\sdl_sound_static___Win32_Debug;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL_net-1.2.8-fixed\VisualC\Release;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release\ZLib;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release;C:\Build\DOSBOX\multi\VS2017\Vista+\COMPILE\SDL-1.2.15\VisualC\Release; 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Expand "Linker" and select "Input". Replace the contents of "Input" with the following: sdl_sound_static.lib;libFLAC_static.lib;libogg_static.lib;libvorbis_static.lib;dinput8.lib;dxguid.lib;opengl32.lib;winmm.lib;zlib.lib;libpng.lib;sdl_net.lib;sdlmain.lib;sdl.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) CHANGES MADE TO ORIGINAL Added: dinput8.lib dxguid.lib Removed: curses.lib (Only needed for DOSBox Debug build) 6. In solution explorer expand "Source Files" and go to visualc and then config.h. Open config.h 7. Change #define C_CORE_INLINE 0 to #define C_CORE_INLINE 1 and then save config.h 8. Compile DOSBOX. **If you ever receive an error about debugging information being corrupt then: a. Right-click on "dosbox" in solution and select properties. b. Click on "Linker" and then click on "Debugging", set "Generate Debug Info" to "No" 9. Go here for the DOSBox binary: C:\Build\DOSBOX\multi\VSXXXX\XXXX\COMPILE\dosbox\visualc_net\Release COMPILE DOSBOX USING VISUAL STUDIO 2005/2008 for Windows 95-98-NT4-2000 1. See above directions for setting up environment. 2. Go to C:\Build\DOSBOX\multi\VS2008\XXXX\COMPILE\dosbox\visualc_net and click on dosbox.sln. 3. In Solution Explorer right-click dosbox and select properties In VS go to Tools->Options-> Project and Solutions -> VC++ Directories For "EXECUTABLE FILES" add: C:\Build\DOSBOX\multi\VS2008\XXXX\COMPILE\legacyextender For "LIBRARY FILES" add: C:\Build\DOSBOX\multi\VS2008\XXXX\COMPILE\legacyextender 4. Click on "Linker" and select "Input" and add these dependencies: legacyextender.lib;kernel32.lib;user32.lib;ole32.lib End result should look like this: legacyextender.lib;kernel32.lib;user32.lib;ole32.lib;sdl_sound_static.lib;libFLAC_static.lib;libogg_static.lib;libvorbis_static.lib;dinput8.lib;dxguid.lib;opengl32.lib;winmm.lib;zlib.lib;libpng.lib;sdl_net.lib;sdlmain.lib;sdl.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) 5. Verify that "Ignore All Default Libaries" is set to "No". 6. For "Ignore Specific Default Libraries" add the following: kernel32.lib;user32.lib;ole32.lib 7. Click "Debugging" and set "Generate Debug Info" to "No". 8. Click on "Build Events", "Post-Build Event" and set "Command Line to "EditVersion "$(TargetPath)" 4.0" 9. Compile! REMOVING DOSBOX ACTIVE DESKTOP REQUIREMENT FOR NT3.5x,95,NT4 To remove IE4+ Active Desktop requirement comment out the following in DOSBox src/misc/cross.cpp. This will also cause the DOSBox icon to not show. Once done the DOSBox dosbox.conf file will be stored in C:\DOSBOX misc/cross.cpp Comment out Lines #42 and #52 #ifdef WIN32 static void W32_ConfDir(std::string& in,bool create) { int c = create?1:0; char result[MAX_PATH] = { 0 }; /* BOOL r = SHGetSpecialFolderPath(NULL,result,CSIDL_LOCAL_APPDATA,c); if(!r || result[0] == 0) r = SHGetSpecialFolderPath(NULL,result,CSIDL_APPDATA,c); if(!r || result[0] == 0) { char const * windir = getenv("windir"); if(!windir) windir = "c:\\windows"; safe_strncpy(result,windir,MAX_PATH); char const* appdata = "\\Application Data"; size_t len = strlen(result); if(len + strlen(appdata) < MAX_PATH) strcat(result,appdata); if(create) mkdir(result); }*/ in = result; } #endif REMOVE DIRECTSOUND,DIRECTDRAW AND OPENGL IN SDL AND DOSBOX FOR NT 3.51 SDL SOURCE NT 3.50-3.51 Make the following changes to SDL_config_win32.h: REMOVE #define SDL_AUDIO_DRIVER_DSOUND 1 #define SDL_VIDEO_DRIVER_DDRAW 1 #define SDL_VIDEO_OPENGL 1 #define SDL_VIDEO_OPENGL_WGL 1 DOSBOX SOURCE src/platform/visualc/config.h REMOVE /* Define to 1 to use opengl display output support */ #define C_OPENGL 1 /* Define to 1 if you have the header file. #define HAVE_DDRAW_H 1 Linker Remove the following Libraries: ws2_32.lib,opengl32.lib,dinput8.lib,dxguid.lib Add the following: wsock32.lib Linker Input should look like: legacyextender.lib;kernel32.lib;user32.lib;ole32.lib;sdl_sound_static.lib;libFLAC_static.lib;libogg_static.lib;libvorbis_static.lib;winmm.lib;zlib.lib;libpng.lib;sdl_net.lib;sdlmain.lib;sdl.lib;odbc32.lib;odbccp32.lib;wsock32.lib;%(AdditionalDependencies) INFO This guide static links to the CRT, this matches the MinGW configuration. I see no alternate without causing problems for the end user and breaking compatibility. TESTING i586 (Pentium) pcem qemu i686 (Pentium Pro+) qemu vmware workstation\player (No ddraw in 9x and NT4) TROUBLESHOOTING VISUAL STUDIO Use /Verbose in linker for more lengthy output for troubleshooting DOSBOX On opening DOSBox if you see a black screen with a blinking prompt then this is because the change in SDL in SDL_dx5video.c was not set, without this change the only solution is to run DOSBox in 16bit color or to use WARP. OLD DOSBOX 8. In Solution Explorer right-click winres.rc and select "View Code" a. Change #include "afxres.h" to #include "Windows.h" and save winres.rc OLD INFO DOSBOX ON NT 3.50 and NT 3.51 NT 3.51 Make the following changes to "SDL.DSP": REMOVE Directx.h SDL_dx5audio.c SDL_dx5audio.h SDL_dx5events.c SDL_dx5events_c.h SDL_dx5video.c SDL_dx5video.h SDL_dx5yuv.c SDL_dx5yuv_c.h NT 3.50 ADD #define NO_CHANGEDISPLAYSETTINGS 1 Make the following changes to "SDL.DSP": REMOVE Directx.h SDL_dx5audio.c SDL_dx5audio.h SDL_dx5events.c SDL_dx5events_c.h SDL_dx5video.c SDL_dx5video.h SDL_dx5yuv.c SDL_dx5yuv_c.h SDL_joystick.c SDL_joystick_c.h SDL_mmjoystick.c SDL_sysjoystick.h DOSBOX /* Define to 1 to enable internal modem support, requires SDL_net */ #define C_MODEM 1 /* Define to 1 to enable IPX networking support, requires SDL_net */ #define C_IPX 1