目录
一、项目创建
打开VS2019,选择新建控制台应用,做好命名和路径设置等基本工作,点击创建。
避免路径出现中文。
二、SFML的配置
1、下载
打开官网:https://www.sfml-dev.org/
找到Download界面,点击下载最新版本。官网下载界面
根据需要下载,开发者说最好选择32位的版本,所以笔者选择下载Visual C++ 15(2017)-32-bit的版本。
2、安装配置
进入Learn版块,进入Tutorials。
在Getting started栏目下找到想要的指引教程,然后按照他说的去做就好了!
1.解压
下载到的文件到某个地方。笔者放在项目文件的边上。
2.打开项目属性设置
在项目名称上右键,找到最下面的属性。
3.设置项目属性
Now we need to tell the compiler where to find the SFML headers (.hpp files), and the linker where to find the SFML libraries (.lib files).
In the project’s properties, add:
The path to the SFML headers (/include) to C/C++ » General » Additional Include Directories
The path to the SFML libraries (/lib)