简体   繁体   English

如何使用 Visual Studio 代码合并 SFML 库?

[英]How can I use Visual Studio code to incorporate the SFML library?

I'd want to use this library in a C++ project I'm working on, but I'm getting the following error: SFML/Graphics.hpp: No such file or directory我想在我正在处理的 C++ 项目中使用这个库,但我收到以下错误:SFML/Graphics.hpp: No such file or directory

Please help me with a bit simpler solution, if possible.如果可能的话,请帮助我提供一个更简单的解决方案。 Since I'm very new to all this.因为我对这一切都很陌生。

Actually there are various method you let your compiler know where is the file, you can do:实际上有多种方法可以让你的编译器知道文件在哪里,你可以这样做:

#include <include/SFML/Graphics.hpp>

but some compilers are different and may or may not have files, or just store them differently.但是有些编译器是不同的,可能有也可能没有文件,或者只是以不同的方式存储它们。 I am pretty sure the issue will be resolved.我很确定这个问题会得到解决。

and also you can give path to the file when you execute the file just put a -I flag:并且您还可以在执行文件时提供文件路径,只需放置一个 -I 标志:

-I/path/to/SFML/headers

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM