Guide:Compiling VVVVVV on Windows with Visual Studio

This page is a guide to compiling VVVVVV on Windows with Visual Studio.

Windows and Visual Studio are chosen because most people use Windows, and most Windows users use Visual Studio.

Setting up Visual Studio
If you don't already have Visual Studio installed, then you will need to download it.

This guide assumes that you will download and install Visual Studio 2022 (the latest non-preview version).

To download Visual Studio:


 * 1) Go to the Visual Studio downloads page.
 * 2) Next to Visual Studio 2022, click Free download under Community.
 * 3)   will be downloaded. Run it.
 * 4) During installation, make sure to check the Desktop development with C++ workload, because VVVVVV is programmed in C++. You can uncheck everything else; they won't be needed.

By the way, Visual Studio 2022 (with the C++ stuff) will take up about 12 gigs on your disk (it gets worse with each version). So if you're almost out of disk space, make sure to clear it up before installing.

Also, you might be prompted to restart your computer before being able to use Visual Studio.

Once you have Visual Studio open, it will ask you to sign in with an account. You don't really have to for now, but if you don't, it considers you on a trial until you sign in with an account. When the trial expires, it will make you sign in with an account anyways. If you are advanced enough, you can extend the license expiration date indefinitely with the VSCELicense PowerShell module and avoid signing in.

Cloning VVVVVV
You will need to download VVVVVV.

"Cloning" just means downloading a repository, but with a mechanism to let you easily download updates to it later, without having to re-download everything all over again. It is recommended to clone the VVVVVV source code repository instead of merely downloading it.

Visual Studio lets you clone Git repositories directly from the app. Doing this also automatically creates a new project for you, too. How convenient!

From the Visual Studio welcome screen:


 * 1) Click on Clone a repository.
 * 2) Enter in   under Repository location.
 * 3) Click Clone.

Downloading dependencies
You will need to download SDL 2.

Note that since VVVVVV 2.2, the game uses SDL 2. There are older versions of SDL (SDL 1.2), but you don't want to use those.

To download SDL:


 * 1) Go to the SDL download page.
 * 2) Under Assets, click on   to download it.
 * 3) In Windows Explorer, right-click on the file, and click on Extract All....
 * 4) Click Extract.
 * 5) Inside the extracted folder, drag   to.
 * 6) * You can put this folder anywhere you want, but the rest of this guide assumes you have it in . If you have it somewhere else, then you will need to change all paths referencing   accordingly.

Generating the VS Solution
You will need to generate the files used to compile the game. Visual Studio's build files are called "Solutions". No, I don't know why they call them that.

Doing this entails opening a command prompt.

 From the menu bar, click on Tools, then Command Line, then Developer Command Prompt. In the command prompt, type . Type, then  . Then enter in this long command: cmake -A Win32 -G "Visual Studio 17 2022" .. -DSDL2_INCLUDE_DIRS="C:\SDL2-2.26.4\include" -DSDL2_LIBRARIES="C:\SDL2-2.26.4\lib\x86\SDL2;C:\SDL2-2.26.4\lib\x86\SDL2main" If you prefer to copy and paste, then after copying the above command, you can paste it in by right-clicking inside the command prompt.  If your  folder is not in , you will need to change the paths in this command. If you didn't check Desktop development with C++ when installing Visual Studio, you'll get an error.  If you are using a Visual Studio version other than Visual Studio 2022, you will need to change the  string to match your Visual Studio version.   </li> </ol>

Compiling
Now you're finally ready to compile the game.

To compile:


 * 1) Navigate to the   folder under   in the Solution Explorer panel on the right side of the screen.
 * 2) * If you don't see it (which is highly likely), then you will need to click the Show All Files icon. Which looks like this: [[File:Visual Studio 2022 Show All Files icon.png]]
 * 3) Double-click on.
 * 4) From the top menu bar, click on Build, then Build Solution. Visual Studio will attempt to compile the game.
 * 5) * If it fails with an error LNK1104 saying "cannot open file 'SDL2.obj'", you will need to re-run the  command in the previous section, but add   to all the   paths of   and , and try again.  Once you do this, there will be a prompt saying that "a file has been modified outside the environment". It's fine to click Ignore All, but if you're worried, you can click Reload All.
 * 6) * If it fails saying that an SDL function was not found (, ,  , or similar), then your SDL is too old.
 * 7) ** VVVVVV 2.3 needs SDL 2.0.14 or later.
 * 8) ** VVVVVV 2.4 needs SDL 2.0.18 or later.

If it succeeds, then you just compiled VVVVVV!

Running
To navigate to the :


 * 1) In the Solution Explorer panel, right-click on VVVVVV.
 * 2) Click on Open Folder in File Explorer.
 * 3) Open the   folder.
 * 4) * If you decided to compile in release mode, then you would open the  folder instead.

You will need to put a copy of  into the same folder as , either by grabbing it from Steam or from downloading them directly from the Make & Play page (click on [Desktop data file]).

Lastly, you also need the SDL 2  in the same folder as. Copy over  (or wherever you put that folder) to the folder.

After that, running  should just work!


 * If you get an error dialogue saying "The application was unable to start correctly (0xc000007b)", that means you copied the 64-bit  instead of the 32-bit one. Copy the   from the   folder and try again.