Page 1 of 6

Building Supermodel on Windows with Visual Studio 2008

PostPosted: Sat Nov 05, 2011 2:47 pm
by nikdd
Building the SVN version of Supermodel with Visual Studio 2008

The following are instructions on how to build with Visual Studio 2008 the latest development version of Supermodel 32-bit or 64-bit from the SVN repository.

These steps have been tested with Visual Studio 2008 Professional on Windows 7. I have no idea whether they will work with Visual Studio 2008 Express Edition or Visual Studio 2010 or even with other versions of Windows.

[Update: daytona has reported that these steps work fine with Vistual Studio 2010 and Vista]

Steps

1. Check out the latest development version of Supermodel from the main trunk in the SourceForge SVN repository with a suitable SVN client, eg:

Code: Select all
svn co https://model3emu.svn.sourceforge.net/svnroot/model3emu/trunk trunk


2. Download the SDL v1.2.14 source (http://www.libsdl.org/release/SDL-1.2.14.zip) and unpack into trunk\Libraries.

3. Download the ZLib v1.2.4 source (http://sourceforge.net/projects/libpng/files/zlib/1.2.4/zlib124.zip/download) and unpack into trunk\Libraries.

4. Download and install the Microsoft DirectX SDK (June 2010) (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812).

5. a) Open the Visual Studio solution Supermodel.sln held in trunk\VS2008,

5. b) Choose whether to build a Debug or Release version of Supermodel (the Debug version builds quicker but runs slower) and whether to target Win32 or x64 architecture,

5. c) Start the build! It will take a while to compile everything but if all goes well you should end up with the following files and directories (amongst many others) in the output directory:

Code: Select all
README.txt
LICENSE.txt
Supermodel.exe
SDL.dll
Config\Supermodel.ini
Saves\
NVRAM\


These files are all that are needed for Supermodel to run (you can ignore the others that are in there).

5. d) If you want to run supermodel from within Visual Studio then before you do so you should go to the property pages of the Supermodel project and set the command arguments as required (ie to point to a ROM) and change the working directory to $(OutDir) (otherwise Supermodel won't be able to locate its Supermodel.ini config file).

Enjoy!

Re: Building SVN version of Supermodel with Visual Studio 20

PostPosted: Sun Nov 06, 2011 3:48 am
by Outrunner
Good nice and all but it still doesn't compile.

Zlib and SDLmain build successfully
Mushashi68K gives me 1 error:
1>Project : error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."

EDIT: The M68K does not build if there is a space in the path (i.e "Project Source") if i change to ProjectSource it works ===> EPIC FAIL
I fell like in the era of Turbo Pascal.

SDL whines about:
1>i:\development\project source\supermodel\libraries\sdl-1.2.14\src\audio\windx5\directx.h(81) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory

Then supermodel whines about its missing M68K files.
Still needs more work but at least you are getting there :) .

Re: Building SVN version of Supermodel with Visual Studio 20

PostPosted: Sun Nov 06, 2011 5:12 am
by nikdd
Outrunner wrote:Zlib and SDLmain build successfully
Mushashi68K gives me 1 error:
1>Project : error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."


The post-build events need quotes added to handle spaces in directory names. I've updated SVN with this change.

Outrunner wrote:SDL whines about:
1>i:\development\project source\supermodel\libraries\sdl-1.2.14\src\audio\windx5\directx.h(81) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory


Ah, apologies - the SDL project was assuming that the DirectX directories had been added to the global VC++ directories - I missed noticing that. I've added the DirectX directories as additional include and library paths of the SDL project instead and have updated SVN with this fix.

Please update your local copy with these SVN changes and try again.

Re: Building SVN version of Supermodel with Visual Studio 20

PostPosted: Sun Nov 06, 2011 8:59 am
by Outrunner
Built successfully with latest svn.

Good Job !!!

Re: Building SVN version of Supermodel with Visual Studio 20

PostPosted: Mon Nov 07, 2011 3:35 am
by nikdd
Outrunner wrote:Built successfully with latest svn.

Good Job !!!


Great - glad it's working :-) !

Re: Building Supermodel on Windows with Visual Studio 2008

PostPosted: Sat Jan 21, 2012 1:34 pm
by j4m3s
build error latest rev.
Error 182 error LNK2001: unresolved external symbol _IID_IWbemLocator DirectInputSystem.obj Supermodel
Error 183 error LNK2001: unresolved external symbol _CLSID_WbemLocator DirectInputSystem.obj Supermodel
Error 184 fatal error LNK1120: 2 unresolved externals c:\Users\JAMES\Documents\supermodel\trunk\VS2008\Win32\Release\Supermodel.exe Supermodel

Re: Building Supermodel on Windows with Visual Studio 2008

PostPosted: Sat Jan 21, 2012 3:28 pm
by Bart
j4m3s wrote:build error latest rev.
Error 182 error LNK2001: unresolved external symbol _IID_IWbemLocator DirectInputSystem.obj Supermodel
Error 183 error LNK2001: unresolved external symbol _CLSID_WbemLocator DirectInputSystem.obj Supermodel
Error 184 fatal error LNK1120: 2 unresolved externals c:\Users\JAMES\Documents\supermodel\trunk\VS2008\Win32\Release\Supermodel.exe Supermodel


I changed DirectInputSystem.cpp to be compatible with GCC on Windows. You will need to add WbemUuid.lib to the list of libraries. Unfortunately, I don't have MSVC on my new computer (I've switched to using GCC) so I'll have to wait until either Nik updates it or someone submits a new project file. If you're building from the Makefile, I can fix it for you.

Re: Building Supermodel on Windows with Visual Studio 2008

PostPosted: Sun Jan 22, 2012 9:34 am
by nikdd
Bart wrote:
j4m3s wrote:build error latest rev.
Error 182 error LNK2001: unresolved external symbol _IID_IWbemLocator DirectInputSystem.obj Supermodel
Error 183 error LNK2001: unresolved external symbol _CLSID_WbemLocator DirectInputSystem.obj Supermodel
Error 184 fatal error LNK1120: 2 unresolved externals c:\Users\JAMES\Documents\supermodel\trunk\VS2008\Win32\Release\Supermodel.exe Supermodel


I changed DirectInputSystem.cpp to be compatible with GCC on Windows. You will need to add WbemUuid.lib to the list of libraries. Unfortunately, I don't have MSVC on my new computer (I've switched to using GCC) so I'll have to wait until either Nik updates it or someone submits a new project file. If you're building from the Makefile, I can fix it for you.


I've updated the VS project with the missing library so hopefully it should compile for everyone now. Please let me know if there are any further problems.

Thanks, Nik.

Re: Building Supermodel on Windows with Visual Studio 2008

PostPosted: Sun Jan 22, 2012 10:10 am
by j4m3s
working again.. THX!

Re: Building Supermodel on Windows with Visual Studio 2008

PostPosted: Wed Feb 01, 2012 9:58 pm
by Daytona
Just to confirm this is working for me.

Windows Vista and Visual Studio 2010 enterprise edition.

Thank you for the detailed instructions and thankyou Bart and other contributors for a fantastic emulator.