今天我决定下载,安装并尝试使用SFML 2.2.我还用MinGW编译器下载了Code :: Blocks.我设置了所有内容并正确安装了所有内容(或者我认为),并尝试运行示例代码以查看它是否可行:
#include
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();
}
return 0;
}
代码编译正确,虽然尝试运行它出现一个错误消息框说“程序入口点_ZSt24__throw_out_of_range_fmtPKcz无法位于动态链接库sfml-graphics-2.dll”.我在网上搜索但没有发现任何与此问题有关的内容,所以我来到这里寻求帮助.感谢进一步的答案.