SFML community forums
Help => Window => Topic started by: jerryd on October 27, 2016, 06:11:51 am
-
SFML forum,
Windows 7, CodeLite 9.2.5, TDM-GCC-64, SFML-2.3.1
As soon as a window opens my program exits with the message:
"SFML-Demo has stopped working"
No error messages from the compiler.
Here's the code:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "My Window");
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
}
}
window.display();
}
}
Any suggestions?
Jerry D.
-
What is the version number for your gcc?
Using pre-built SFML libraries (if so, which?), or compiled yourself?
-
dabbertorres,
Thanks for the reply.
Don's see a version for the compiler. The folder size is 348MB.
I just downloaded pre-built SFML files.
Jerry D.
-
Open a command line and run gcc -v inside the compiler's bin directory.
Which package did you download?
-
eXpl0it3r,
Ran your suggested command and it yielded "gcc version 5.1.0 (tdm64-1)"
Thanks,
Jerry D.
-
We never provided builds for GCC 5.1, as stated on the download page: The compiler versions have to match 100%!
Either you pick a compiler linked on the download page or you build SFML yourself.
Also make sure that you copy the needed DLLs as stated in the official tutorials.
-
Pretty sure I copied all the correct .dll files to the Debug folder.
The only difference is the tutorial suggested the libgcc_S_sjlj-1.dll
with an upper case 'S" but the actual one in the bin folder had a
lower case 's' libgcc_s_sjlj-1.dll.
How do I get the compiler versions to match?
I don't really know how the compiler and the SFML relate to each other.
Jerry D.
-
How do I get the compiler versions to match?
Either you pick a compiler linked on the download page or you build SFML yourself.
-
OK I'll reinstall everything.
There are 2 choices at sfml-dev.org
GCC 4.9.2 TDM(SJLJ) - 64-bit
GCC 6.1.0 MinGW(SEH) - 64-bit
Would either work or would you recommend a specific one?
-
I personally would go with GCC 6.1.0.