【发布时间】:2018-04-12 17:58:18
【问题描述】:
我正在使用 SFML,我一直在尝试使用顶点数组,但是每当我写类似的东西时
sf::Vertex vertex;
并编译,它给了我一个错误提示
'Vertex' 不是 sf 的成员
#include<iostream>
#include<SFML/Graphics.hpp>
#include<Vertex.hpp>
int main(){
sf::RenderWindow window(sf::VideoMode(200,200), "SFML WORKS");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
sf::Vertex vertex;
return 0;
}
它现在也给我一个错误说:
"SFMLtest.cpp:3:9: fatal error: Vertex.hpp: No such file or directory
#include<Vertex.hpp>"
【问题讨论】:
-
显示代码。在没有任何说明您如何到达那里的情况下发布告诉我们您遇到的错误是没有用的;它只会导致无用的猜测。但请注意,请确保您只包含正确的标题...
-
阅读帮助中心以了解如何提问。不应将基本信息倾倒在 cmets 中。评论仅用于额外讨论。 Edit您的帖子以包含读者评估它所需的所有信息。
-
感谢您的反馈。我已将代码添加到帖子中。
-
转到“如何为初学者编译代码”教程中的下一步:告诉编译器在哪里可以找到包含。