尝试使用gui c ++时出错

时间:2014-06-18 22:33:51

标签: c++ windows user-interface sfml

我一直在使用Windows上的c ++编写SFML游戏。我现在已经完成了游戏,并且我一直在尝试使用TGUI创建GUI,因为它看起来简单易用。我已经在我的VC ++项目中进行了设置,并编写了一段看似简单的代码。

#include <SFML/Window.hpp>
#include <TGUI/TGUI.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
    tgui::Gui gui(window);

    while (window.isOpen())
    {
        sf::Event event;

        while (window.pollEvent(event))
        {
            gui.handleEvent(event);
        }

        window.clear();
        gui.draw();
        window.display();
    }

    return 0;
}

代码编译很好,但是当我启动代码时,我会立即编译 Test.exe中0x80002610处的未处理异常:0xC0000005:访问冲突执行位置0x80002610。

我想知道访问违规可能来自哪里。谢谢你的帮助。

0 个答案:

没有答案