Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
253 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...