Quick Reference - Using Using Visual Studio


How to set up SFML with Visual Studio

Step-by-step video:

Text guide:

1. Download the Visual C++ 15 (2017) - 32-bit version of the library from the Downloads Page.

2. Extract the SFML-2.5.1 folder to your C:\ drive or a location with no spaces. For example, C:\Users\YOU\SFML-2.5.1\.

Copy the path to your SFML folder, like C:\Users\YOU\SFML-2.5.1\, we will use this later.

3. Create a new visual studio project or open an existing one.

4. Set the program build to Release mode.

5. Make sure the CPU build is set to x86 (The "Any CPU" option might also work).

6. Right-click on the project in your Solution Explorer and go to Properties.

7. Under Configuration Properties ➤ C/C++ ➤ General, locate the Additional Include Directories field.

Click on the down arrow, and then "Edit...".

In the dialog box, paste in your SFML directory and put "include\" at the end, like this:
C:\Users\YOU\SFML-2.5.1\include\



8. Under Configuration Properties ➤ Linker ➤ General, locate the Additional Library Directoreis field.

Click on the down arrow, and then "Edit...".

In the dialog box, paste in your SFML directory and put "lib\" at the end, like this:
C:\Users\YOU\SFML-2.5.1\lib\

9. Under Configuration Properties ➤ Linker ➤ Input, locate the Additional Dependencies field.

Click on the down arrow, and then "Edit...".
 
In the textbox, add:
sfml-graphics.lib;sfml-window.lib;sfml-system.lib;
in that order. (You can also put each on a new line instead of separated by ;).

You should now be able to build and run your SFML program.

If you experience any additional errors, try to search for the error message (plus "SFML") in your search engine to look for solutions other people have found.