Locate the Additional Include Directories edit box and type the drive letter where your SFML folder is followed by \SFML\include.Select C/C++ then General from the left-hand menu.Select All Configurations from the Configuration: drop-down.In the resulting HelloSFML Property Pages window take the following steps which are numbered and can be referred to in the next image. We can achieve the above by doing the following:įrom the Visual Studio main menu select Project | HelloSFML properties. In addition, we need to tell Visual Studio where it can find the SFML library files. All this will become clearer when we eventually start adding our own header files in a few projects time.
#Hello world c++ visual studio code code#
Note that the header files are distinct from the main source code files and they are contained in files with the.
#Hello world c++ visual studio code how to#
So when we use the SFML code the compiler knows how to handle it. Header files are the files that define the format of the SFML code. The special type of file I am referring to is a header file. What we need to do is to tell Visual Studio, or more specifically the code compiler that is part of Visual Studio where to find a special type of code file from the SFML SDK. This is the laborious part but we will only need to do this once. Next, we will add some fairly intricate and vital project settings. The slightly dull (but important) configuration stuff and Visual Studio will create our new project. When you have completed the steps above click OK. This will be the location that all our project files will be kept. Next, browse to the Visual Studio Stuff\Projects\ folder that we created in the Setting up a Visual Studio 2017 and SFML development environment project. This is what we will do in this project but we will quickly get closer and closer to a real game as we progress through future projects. It is a tradition when learning a new language to start making a program which says “Hello World” to the user. Now at the bottom of the New Project window type HelloSFML in the Name: field. You can see all these selections in the next screenshot. In the New Project window choose Visual C++ || Windows Desktop then Win32 Console Application. Start Visual Studio 2017 and select File | New Project. When we have done this we will finally get to see SFML in action as we draw some fancy text to the screen. We will however be saving these configurations in a Visual Studio template so that all future projects can be started with a couple of clicks. It is true that there is quite a bit of messing around to be done with regard to configuring our first project to use SFML in the way that we need. In this project we will start from the very beginning as this is our first SFML project.