Open main menu

Difference between revisions of "Compiling ScummVM/Visual Studio"

no edit summary
(Remove some more references to MSVC2005)
Line 1: Line 1:
== Compiling ScummVM with Visual Studio 2008/2010 under Windows ==
== Compiling ScummVM with Visual Studio under Windows ==


Compiling ScummVM under Windows is not an awfully hard task, however there are some things that don't just work out of the box
Compiling ScummVM under Windows is not an awfully hard task, however there are some things that don't just work out of the box
Line 7: Line 7:
== Things needed ==
== Things needed ==


=== Visual Studio 2010 or 2008 ===
=== Visual Studio 2013 ===
There exist several versions of Visual Studio 2010. A feature comparison can be found  
There exist several versions of Visual Studio 2013. A feature comparison can be found  
[http://www.microsoft.com/visualstudio/en-us/products/2010-editions/product-comparison here]
[http://www.visualstudio.com/en-US/products/compare-visual-studio-products-vs here]


You can obtain the free Express version of Visual C++ 2010 [http://www.microsoft.com/express here]
You can obtain the free Express version of Visual C++ 2013 [http://www.microsoft.com/express here]


Although Visual Studio 2010 or 2008 is preferred, older versions of Visual Studio may work so long as you have them updated to their latest Service Pack revisions. In fact, we suggest making sure that you always have the latest Service Packs and patches applied for these tool sets. In some cases, fixes were put into the free-to-download "Processor Pack" add-on for Visual C++. So, download the latest Service Pack and the latest Processor Pack for whatever version of Visual C++ you are using to make sure you won't run into compiler bugs that prevent the compilation of scummvm.
Although Visual Studio 2013 or 2012 is preferred, older versions of Visual Studio may work so long as you have them updated to their latest Service Pack revisions. In fact, we suggest making sure that you always have the latest Service Packs and patches applied for these tool sets. In some cases, fixes were put into the free-to-download "Processor Pack" add-on for Visual C++. So, download the latest Service Pack and the latest Processor Pack for whatever version of Visual C++ you are using to make sure you won't run into compiler bugs that prevent the compilation of ScummVM.


=== Additional tools ===
=== Additional tools ===
Line 33: Line 33:
** msvc10 for Visual Studio 2010
** msvc10 for Visual Studio 2010
** msvc11 for Visual Studio 2012
** msvc11 for Visual Studio 2012
** msvc12 for Visual Studio 2013
* Skip to step "[[Compiling_ScummVM/Visual_Studio#Ready to compile ScummVM|Ready to compile ScummVM]]"
* Skip to step "[[Compiling_ScummVM/Visual_Studio#Ready to compile ScummVM|Ready to compile ScummVM]]"


Line 39: Line 40:




== Adding all libraries to Visual Studio 2010==
== Adding all libraries to Visual Studio 2010 and newer==


The way libraries are added has been changed in Visual Studio 2010, compared to earlier versions. Copy all of the precompiled libraries in a separate folder (e.g. c:\scummvm_libs). Then, there are two different ways of adding this directory to Visual Studio:
The way libraries are added has been changed in Visual Studio 2010, compared to earlier versions. Copy all of the precompiled libraries in a separate folder (e.g. c:\scummvm_libs). Then, there are two different ways of adding this directory to Visual Studio:
* Right click My Computer->Properties->Advanced (Win 2000/XP) or Advanced System Settings->Advanced (Vista/Win 7)->Environment Variables->New (System Variable), with a variable name of "SCUMMVM_LIBS" and a value of the folder where you unpacked your precompiled libraries (e.g. "C:\scummvm_vs_libs"). You need to restart Visual Studio, if it's already running, for the change to take effect.
* Right click My Computer->Properties->Advanced (Win 2000/XP) or Advanced System Settings->Advanced (Vista/Win 7/Win 8)->Environment Variables->New (System Variable), with a variable name of "SCUMMVM_LIBS" and a value of the folder where you unpacked your precompiled libraries (e.g. "C:\scummvm_vs_libs"). You need to restart Visual Studio, if it's already running, for the change to take effect.
* If the above method doesn't work, open the ScummVM solution in Visual Studio, and go to View->Property Manager or View->Other Views->Property Manager (depending on your layout configuration). From there, open the scummvm project, and go to the configuration you want to build (e.g. Debug|Win32) and click on "Microsoft.Cpp.Win32.user". From there, go to "VC++ directories" and add the 3 library directories in the appropriate places, i.e.:
* If the above method doesn't work, open the ScummVM solution in Visual Studio, and go to View->Property Manager or View->Other Views->Property Manager (depending on your layout configuration). From there, open the ScummVM project, and go to the configuration you want to build (e.g. Debug|Win32) and click on "Microsoft.Cpp.Win32.user". From there, go to "VC++ directories" and add the 3 library directories in the appropriate places, i.e.:


   Executable Directories: add "C:\scummvm_vs_libs\bin;" at the beginning
   Executable Directories: add "C:\scummvm_vs_libs\bin;" at the beginning
Line 49: Line 50:
   Library Directories: add "C:\scummvm_vs_libs\lib\x86" (or x64, if you're building a 64-bit version) at the beginning
   Library Directories: add "C:\scummvm_vs_libs\lib\x86" (or x64, if you're building a 64-bit version) at the beginning


If if still fails to build, saying it can't find a lib file, go to the project properties of the scummvm project, Configuration Properties->Linker->General->Additional Library Directories and add your lib folder in there
If if still fails to build, saying it can't find a lib file, go to the project properties of the ScummVM project, Configuration Properties->Linker->General->Additional Library Directories and add your lib folder in there




Line 119: Line 120:
If you got all the libraries compiled, you're ready to compile the latest version of ScummVM!
If you got all the libraries compiled, you're ready to compile the latest version of ScummVM!


Open the solution file in dists\msvcXX (msvc10 for VS2010 or msvc9 for VS2008), select the "Release" configuration from the configuration manager pulldown menu and then go to Build->Build solution, or just press Control-F7 to compile it.
Open the solution file in dists\msvcXX, select the "Release" configuration from the configuration manager pulldown menu and then go to Build->Build solution, or just press Control-F7 to compile it.


The ScummVM executable should be in the folder dists\msvc9\scummvm_Release as "scummvm.exe".
The ScummVM executable should be in the folder dists\msvcXX\scummvm_Release as "scummvm.exe".


You'll need to copy sdl.dll from the SDL runtime archive (or the latest devel archive) in the directory where scummvm.exe is
You'll need to copy sdl.dll from the SDL runtime archive (or the latest devel archive) in the directory where scummvm.exe is
3

edits