Open main menu

Difference between revisions of "Compiling ScummVM/Visual Studio"

no edit summary
m (Add a note about the stopgap workaround for VS2019 structure packing)
Line 7: Line 7:


=== Visual Studio ===
=== Visual Studio ===
There exists a free Community version of Visual Studio [https://visualstudio.microsoft.com/ here] that can be used.
There exists a free Community version of Visual Studio [https://visualstudio.microsoft.com/vs/ here] that can be used.
Professional Visual Studio versions are working fine too.
Professional Visual Studio versions are working fine too.
When installing Visual Studio 2017 or later, make sure to select the "Desktop Development with C++" workload.


We do support older versions of Visual Studio too. However, on this page we focus on building ScummVM with latest Visual Studio. Building ScummVM with older Visual Studio 2008 can require additional work not described on this page.
We do support older versions of Visual Studio too. However, on this page we focus on building ScummVM with latest Visual Studio. Building ScummVM with older Visual Studio 2008 can require additional work not described on this page.
Line 19: Line 21:
To make it work you have to follow these steps:
To make it work you have to follow these steps:
* Unzip the library zip to a directory of your choice. For example, you can unzip them into "C:\Users\YourUsername\Documents\scummvm_libs_2015".
* Unzip the library zip to a directory of your choice. For example, you can unzip them into "C:\Users\YourUsername\Documents\scummvm_libs_2015".
* Go to Control Panel -> Environment Variables and set up a new variable "SCUMMVM_LIBS" with a value of the path you extracted the zip in. It is important that you do point the variable to the folder containing the "bin", "include", and "lib" directories.
* Go to Start Menu > Control Panel > System > Advanced Settings > Environment Variables and add a new variable "SCUMMVM_LIBS" with a value of the path you extracted the zip in. It is important that you do point the variable to the folder containing the "bin", "include", and "lib" directories.


=== Manually Building Libraries ===
=== Manually Building Libraries ===
Line 44: Line 46:
Simply open the generated solution file in "dists\msvc\scummvm.sln". Now you can ask it to build the desired configuration. By default it will build a debug configuration which is ideal to hack on ScummVM.
Simply open the generated solution file in "dists\msvc\scummvm.sln". Now you can ask it to build the desired configuration. By default it will build a debug configuration which is ideal to hack on ScummVM.


'''IMPORTANT''': You'll need to copy the matching SDL.dll file to a location Windows picks up to run the resulting binary. The easiest way to do this is to place the SDL.dll file in the directory where scummvm.exe is. There are multiple SDL.dll files to choose from, depending on your build configuration. Simply pick the right one from the prebuilt libraries. For example, if you build a Win32 Debug configuration, you will need to use "libs/x86/Debug/SDL.dll".
'''IMPORTANT''': You'll need to copy the matching SDL2.dll file to a location Windows picks up to run the resulting binary. The easiest way to do this is to place the SDL2.dll file in the directory where scummvm.exe is (dists\msvc\Debug). There are multiple SDL2.dll files to choose from, depending on your build configuration. Simply pick the right one from the prebuilt libraries. For example, if you build a Win32 Debug configuration, you will need to use "libs/x86/Debug/SDL2.dll".


NOTE: Several people have had errors about structure packing under Visual Studio 2019. In such cases, whilst we haven't figured out a proper solution, we have a stop-gap workaround for now.. go to Project Options -> C/C++ -> Preprocessor, and put the following text at the start of the Preprocessor Definitions line:
NOTE: Several people have had errors about structure packing under Visual Studio 2019. In such cases, whilst we haven't figured out a proper solution, we have a stop-gap workaround for now.. go to Project Options -> C/C++ -> Preprocessor, and put the following text at the start of the Preprocessor Definitions line:
84

edits