SFML Displaying Sprite Error 0xC0000005: Access violation reading location 0x00D54000

血红的双手。 提交于 2019-12-11 19:32:30

问题


I wrote this code while following the tutorial for SFML in C++:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(600, 400), "Sandstorm");
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();

        }
        window.clear(sf::Color::Black);
            sf::Texture back;
            if (!back.loadFromFile("greenBack.png"))
            return 1;
            sf::Sprite sprite;
            sprite.setTexture(back);
            window.draw(sprite);
        window.display();
    }
    return 0;
}

I kept on getting the same errors when I tried to run it. I might have done something wrong while setting the project up, I'm using Visual Studio 2012. I have the images and libraries in the same folder as my .exe and I keep on getting these errors:

First-chance exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. Unhandled exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. First-chance exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. Unhandled exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. First-chance exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. Unhandled exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. First-chance exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. Unhandled exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. First-chance exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. Unhandled exception at 0x695DDCF8 (msvcr110.dll) in Sandstorm.exe: 0xC0000005: Access violation reading location 0x00D54000. The thread 0x1858 has exited with code 0 (0x0). The program '[6616] Sandstorm.exe' has exited with code 0 (0x0).

if I go to msvrc110.ddl, it gives me errors here:

    rep     movsd           ;N - move all of our dwords

Can anyone help?

来源:https://stackoverflow.com/questions/22086134/sfml-displaying-sprite-error-0xc0000005-access-violation-reading-location-0x00d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!