Hi everyone,
Before going on any further, I want to say that I do have checked the forum and google for information about this and I couldn't find any piece of information to help me.
I created a basic SFML project on CLion using Conan as a package manager. Everything builds successfully so I guess everything is correctly linked. But when I launch the program, it opens a window and then automatically crashes with the following message:
Failed to create input context for window -- TextEntered event won't be able to return unicode
free(): invalid pointer
I think that this might be caused by the i3wm I use but I'm not competely sure.
Code that is run:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
Gives the same error message with the following code
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
}
In the source I found out that it crashes exactly here
https://github.com/oprypin/sfml/blob/20af2a4dfacac81407521f7812ea04fe5f7216b0/src/SFML/Window/Unix/WindowImplX11.cpp#L792OS details:
Ubuntu 18.04
Clion 2020.1
SFML 2.5.2typo, it's SFML 2.5.1
i3wm
Any help would be really appreciated, thank you all!
P.S. This is the first time I setup SFML in ubuntu so I wouldn't surprised to know that it is a missing configuration.