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 2019 (the latest non-preview version).

To download Visual Studio:


 * 1) Go to the Visual Studio downloads page.
 * 2) Next to Visual Studio 2019, click Free download under Community.
 * 3)   will be downloaded. Run it.
 * 4) During installation, make sure to check Desktop development with C++, because VVVVVV is programmed in C++.

By the way, Visual Studio 2019 (with the C++ stuff) will take up about 8 gigs on your disk. 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.

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 and SDL_mixer 2.

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

SDL
To download SDL:


 * 1) Go to the SDL download page.
 * 2) Under Development Libraries:, 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.

SDL_mixer
To download SDL_mixer:


 * 1) Go to the SDL_mixer page.
 * 2) Under Development Libraries:, 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 16 2019" .. -DSDL2_INCLUDE_DIRS="C:\SDL2-2.0.16\include;C:\SDL2_mixer-2.0.4\include" -DSDL2_LIBRARIES="C:\SDL2-2.0.16\lib\x86\SDL2;C:\SDL2-2.0.16\lib\x86\SDL2main;C:\SDL2_mixer-2.0.4\lib\x86\SDL2_mixer"  If your  and   folders are 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 2019, 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 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. VVVVVV 2.3 needs SDL 2.0.14 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 and SDL_mixer 2 s in the same folder as. Copy over  and   (or wherever you put those folders) to the folder.

After that, running  should just work!