Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Window won't stay open  (Read 4660 times)

0 Members and 1 Guest are viewing this topic.

jerryd

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Window won't stay open
« 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.

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: Window won't stay open
« Reply #1 on: October 27, 2016, 06:49:53 am »
What is the version number for your gcc?

Using pre-built SFML libraries (if so, which?), or compiled yourself?

jerryd

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Window won't stay open
« Reply #2 on: October 27, 2016, 07:45:21 am »
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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Window won't stay open
« Reply #3 on: October 27, 2016, 09:02:34 am »
Open a command line and run gcc -v inside the compiler's bin directory.
Which package did you download?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jerryd

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Window won't stay open
« Reply #4 on: October 27, 2016, 05:54:42 pm »
eXpl0it3r,

 Ran your suggested command and it yielded "gcc version 5.1.0 (tdm64-1)"

Thanks,
Jerry D.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Window won't stay open
« Reply #5 on: October 27, 2016, 06:31:23 pm »
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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jerryd

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Window won't stay open
« Reply #6 on: October 27, 2016, 06:44:52 pm »

 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Window won't stay open
« Reply #7 on: October 27, 2016, 07:35:29 pm »
How do I get the compiler versions to match?
Either you pick a compiler linked on the download page or you build SFML yourself.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jerryd

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Window won't stay open
« Reply #8 on: October 27, 2016, 08:54:29 pm »

 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?



eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Window won't stay open
« Reply #9 on: October 27, 2016, 09:16:09 pm »
I personally would go with GCC 6.1.0.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/