SFML community forums

Help => General => Topic started by: evanperryg on August 12, 2017, 08:17:58 pm

Title: SFML with MinGW- Not Responding
Post by: evanperryg on August 12, 2017, 08:17:58 pm
Hello, I am trying to use the SFML libraries in CodeLite using MinGW. I'm pretty familiar with SFML itself but I'm having trouble getting it to work in MinGW. I can build the program but when I run it I get "main.cpp has stopped responding." Here is my code:

#define SFML_STATIC

#include <iostream>

#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "POS");

    while (window.isOpen())
    {
       
        sf::Event event;
        while (window.pollEvent(event))
        {
           
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }
   
    return 0;
}
 

Here is a screenshot of my build settings (this is the only part that's not default):
(https://i.imgur.com/LWJEmcX.jpg)

Here is a screenshot of the project settings, showing include paths and the preprocessor command:
(https://i.imgur.com/tchmQoT.jpg)

Here is more of the project settings, showing the project-specific libraries search path and the Libraries section.
(https://i.imgur.com/OXOniMD.jpg)

I have tried using "sfml-xxxxx," "sfml-xxxxx-d," "sfml-xxxxx-s," "sfml-xxxxx-s-d" in the Libraries section, and when I build and run the program, I always get this:
(https://i.imgur.com/MLy7LPg.jpg)

Other things:
-I'm using Windows 10 64-bit.
-I have tried these resources, among others: https://en.sfml-dev.org/forums/index.php?topic=18820.0 (https://en.sfml-dev.org/forums/index.php?topic=18820.0), https://en.sfml-dev.org/forums/index.php?topic=11284.0 (https://en.sfml-dev.org/forums/index.php?topic=11284.0), https://stackoverflow.com/questions/35712754/sfml-applications-has-stopped-responding (https://stackoverflow.com/questions/35712754/sfml-applications-has-stopped-responding)

Hopefully someone can help. Thanks!

Title: Re: SFML with MinGW- Not Responding
Post by: FRex on August 13, 2017, 12:06:05 am
You need to call window.display (and clear and/or some drawing) in the while window.isOpen() loop.
Title: Re: SFML with MinGW- Not Responding
Post by: eXpl0it3r on August 13, 2017, 01:33:40 am
Basically, read the official tutorials nd follow them. ;)
Title: Re: SFML with MinGW- Not Responding
Post by: evanperryg on August 13, 2017, 05:30:50 am
You need to call window.display (and clear and/or some drawing) in the while window.isOpen() loop.

This code is literally copy-pasted from the tutorials page: https://www.sfml-dev.org/tutorials/2.0/window-window.php (https://www.sfml-dev.org/tutorials/2.0/window-window.php)

Basically, read the official tutorials nd follow them. ;)

As I said in the original post, I followed the instructions given here: https://en.sfml-dev.org/forums/index.php?topic=18820.0 (https://en.sfml-dev.org/forums/index.php?topic=18820.0) and have not found success.

I'm aware of the redundancy of having libraries included in both the global build settings and the project build settings. I've tried placing them in the project settings, and the global settings with no success.
Title: Re: SFML with MinGW- Not Responding
Post by: evanperryg on August 13, 2017, 06:45:52 am
Okay, well. I'm not really sure what I did that fixed it, but whatever I did it works now. For any equally confused CodeLite users in the future:
Title: Re: SFML with MinGW- Not Responding
Post by: eXpl0it3r on August 13, 2017, 08:33:33 am


  • I used the "GCC 6.1.0 MinGW (SEH) - 64-bit" package from the SFML download page.
  • I'm using the TDM-GCC version of MinGW.
This doesn't work. As stated on the download page, compiler and libraries need to match 100%.