Visual Studio代码 - 找不到SFML库
Visual Studio Code - SFML libraries not found
我正在尝试在VSCODE中尝试SFML,但是我的库并未找到我。
我尝试更改c_cpp_properties.json
文件以将库添加到includePath
,但仍未找到。
这是主要类:
#include <iostream>
#include <Window.hpp>
#include <Graphics.hpp>
int main()
{
// create the window
sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
// clear the window with black color
window.clear(sf::Color::Black);
// draw everything here...
// window.draw(...);
// end the current frame
window.display();
}
return 0;
}
这是属性文件:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/Users/arnavchandra/Desktop/tic/SFML-2.5.1-macos-clang/include/SFML/"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
对于#include <iostream>
,我会遇到此错误:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/arnavchandra/Desktop/tic/main.cpp).
对于#include <Graphics.hpp>
,我会遇到此错误:
cannot open source file "SFML/Window.hpp" (dependency of "Graphics.hpp")
当我运行它时,我会收到此错误:
main.cpp:2:10: fatal error: 'Window.hpp' file not found
1 error generated.
您应该尝试将SFML-2.5.1-macos-clang/include/**
而不是SFML-2.5.1-macos-clang/include/SFML/
放在includePath
中。
相关文章:
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- 找不到成员对象:没有名为get_event()的成员,也处理多态性和向量
- 为什么野牛仍在使用"int yylex(void)",却找不到"int yylex(YYS
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 奇怪的(对我来说)返回声明 - 在谷歌上找不到任何关于它的信息
- 找不到QtResource文件中的文件
- VC++本机单元测试,找不到调试符号
- RegGetValue在当前用户下找不到名称
- 带有 -stdlib=libc++ 的 clang++ 9.0.1 找不到<optional>
- c++找不到具有相同哈希的无序集合元素
- 1d.exe找不到SFML文件?
- SFML 库未加载错误,找不到图像
- 编译器找不到 SFML/Graphics.hpp,但它已添加到 includeirs 中
- 找不到 SFML 库
- Visual Studio代码 - 找不到SFML库
- 致命错误:找不到 SFML/System.hpp' 文件
- 使用CMAKE和GCC(MacOS Sierra)编译时找不到SFML标头
- 在 Codelite 中链接 SFML,找不到库
- SFML 错误,出现C++,找不到入口点
- SFML 程序找不到 libGLEW