1

我正在尝试在树莓派(树莓派操作系统)上编译和运行一个简单的 SFML 代码。它确实编译没有任何错误。当我运行它时,出现以下错误。

X Error of failed request: BadMatch (invalid parameter attributes)
    Major opcode of failed request: 1 (X_CreateWindow)
    Serial number of failed request: 34
    Current serial number in output stream: 36

我正在使用 SFML 1.6 版(sudo apt-get install libsfml-dev)

这是我的代码:

#include <SFML/Window.hpp>
int main()
{
    sf::Window window(sf::VideoMode(800, 600), "My window");

    while (window.IsOpened())
    {
        sf::Event event;
        while (window.GetEvent(event))
        {
            if (event.Type == sf::Event::Closed)
                window.Close();
        }
    }

    return 0;
}
4

0 回答 0