一起使用 Steamworks 和 SFML 时程序退出时抛出异常:
Exception thrown at 0x00007FFA919D024E (ntdll.dll) in Project1.exe: 0xC0000005: Access violation reading location 0x0000000000000010.
我已经将程序缩减为最基本的内容,但仍然遇到问题:
#include <SFML/Graphics.hpp>
#include <steam/steam_api.h>
int main()
{
SteamAPI_Init();
sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "Title", sf::Style::Close);
while (window.isOpen())
{
sf::Event e;
while (window.pollEvent(e))
{
switch (e.type)
{
case sf::Event::Closed:
{
window.close();
break;
}
}
}
}
SteamAPI_Shutdown();
return 0;
}