

On C/C++ section->Preprocessor*, modify Preprocessor definitions field by adding SFML_STATIC definition. Over C/C++ section, modify Additional include directories field by adding this path $(ProjectDir)\SFML-2.5.1\include. Open Project Properties and select Debug-Static configuration. Repeat creating a Release-Static configuration. You can call it Debug-Static and copy it from Debug configuration (also, uncheck Create new.). With your active solution platform selected, click on Configuration (of the project) and New. Create Debug-Static and Release-Static compilation profiles. Note, on step 6, library files doesn't have -d suffix, because they're release libraries Repeat steps 3 to 6 with Release-Dynamic configuration.Note -d suffix to indicate debug libraries lib files can be found.įinally, on Linker->Input, modify Additional dependencies field by adding all. On Linker section, modify Additional library directories field by adding this path $(ProjectDir)\SFML-2.5.1\lib. Select Debug-Dynamic configuration and modify field Environment with this value PATH=$(ProjectDir)\SFML-2.5.1\bin %PATH%. Repeat creating a Release-Dynamic configuration. You can call it Debug-Dynamic and copy it from Debug configuration (also, uncheck Create new.). I prefer to uncheck Create new project platforms.Ĭreate Debug-Dynamic and Release-Dynamic compilation profiles. Click on Active Solutions Platform->New, select 圆4 copying from Win32 configuration.
#Sfml cmake visual studio 64 bits#
If you are using a 64 bits library, first you should create a new Solution Platform. Sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!")

Create a folder called extlib inside the library folder and place this external libraries there.Ĭreate a main.cpp file, and paste the example code from SFML tutorials. This will create a folder named SFML-X.X.X depending on your version.ĭownload the external libraries, in my case 64 bits version. Create it as ConsoleApplication and check Empty Project.ĭownload sfml libraries, latest stable version preferably, selecting your corresponding system (in my case Visual C++ 12 (2013) - 64-bit). Let's create a VS project (I will use VS2013 and SFML 2.5.1, but it's pretty much the same with other versions).
#Sfml cmake visual studio how to#
I will divide this answer in two groups, how to configure sfml as a dynamic library and how to do it as a static library. First, I recommend carefully follow the SFML tutorial about configuring the library in Visual Studio, if something goes wrong, then check this answer.
