我试图在raspberry pi(raspbian os)上编译并运行一个简单的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;
}