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

Author Topic: No errors returned when compiling but get "program is not responding message"  (Read 8079 times)

0 Members and 1 Guest are viewing this topic.

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
I've just intalled SFML 2.1 along with Codeblocks (MinGW). I've changed the linker settings, copied the .dlls into the project directory and added 'SFML_DYNAMIC' to the #defines section. I can build the workspace with no problems and get no errors returned. But when I try to build and run this sample code from the SFML guide:

Code: [Select]
#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;
}

I get a "program is not responding" message from windows.

I'm running Windows 7 with Codeblocks 12.11 (MinGW) and SFML 2.1 (the last link in the windows section: http://www.sfml-dev.org/download/sfml/2.1/).

What am I missing?

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
added 'SFML_DYNAMIC' to the #defines section.

Did you read the Tutorial carefully? Because you only need to define SFML_STATIC for static linking, but you never need to define SFML_DYNAMIC...


Quote
(the last link in the windows section: http://www.sfml-dev.org/download/sfml/2.1/)

Wich version have you downloaded? "GCC 4.7 MinGW (DW2) - 32 bits" or "GCC 4.7 TDM (SJLJ) - 64 bits". Both are the last links of their column.


AlexAUT

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
added 'SFML_DYNAMIC' to the #defines section.

Did you read the Tutorial carefully? Because you only need to define SFML_STATIC for static linking, but you never need to define SFML_DYNAMIC...


Quote
(the last link in the windows section: http://www.sfml-dev.org/download/sfml/2.1/)

Wich version have you downloaded? "GCC 4.7 MinGW (DW2) - 32 bits" or "GCC 4.7 TDM (SJLJ) - 64 bits". Both are the last links of their column.


AlexAUT

Ok I've removed the SFML_DYNAMIC. I downloaded the "GCC 4.7 MinGW (DW2) - 32 bits" version. I've now re-installed codeblocks and the sample code from the tutorial simply doesn't run. Build and run gives the message "It seems that this project has not been built yet. Would you like to build it now?" if I click yes the message simply pops up again. When I attempt to "compile this file" I get 20 of the following error messages:

main.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[sf::CircleShape::~CircleShape()]+0x28)||undefined reference to `_imp___ZN2sf5ShapeD2Ev'|

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Quote
The codeblocks-12.11mingw-setup.exe file includes the GCC compiler and GDB debugger from TDM-GCC (version 4.7.1, 32 bit).

You have the wrong sfml package."GCC 4.7 TDM (SJLJ) - 32 bits"  should be the right package...



AlexAUT

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
Quote
The codeblocks-12.11mingw-setup.exe file includes the GCC compiler and GDB debugger from TDM-GCC (version 4.7.1, 32 bit).

You have the wrong sfml package."GCC 4.7 TDM (SJLJ) - 32 bits"  should be the right package...



AlexAUT

Ok I've reinstalled using that package. I get no compile errors, but build and run still results in "program is not responding".

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
I've redone the tutorial and I still have no errors when rebuilding the workspace or compiling the code. Build and run results in no window being displayed and the error message: Process terminated with status -1073741819 (0 minutes, 5 seconds)

I've also tried having the lib as static and I can't even compile the code. It gives 50 + error messages similar to: D:\developpement\sfml\sfml\src\SFML\Graphics\CircleShape.cpp|35|undefined reference to `_Unwind_SjLj_Register'|
« Last Edit: July 30, 2013, 02:49:24 am by ifconfused »

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
This is driving me nuts. I know I must have missed something but I simply can't find it. I've taken screenshots of the settings. I'm still getting no compile errors.

http://pho.to/3ALXe

Hopefully someone can tell me where I've been an idiot. Any help would be awesome, thanks.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Everything works fine here...

Make sure you're using the latest graphics driver.
Run the application through the debugger to figure out what causes the crash.
Try to reinstalling Code::Blocks.
Use a different compiler than the TDM.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
When run through the debugger I get the following:
Code: [Select]
Child process PID: 7020
Program received signal SIGSEGV, Segmentation fault.
In std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_Alloc_hider::_Alloc_hider (this=0x2, __dat=0x373364, __a=...) at d:/programmes/mingw-tdm32-4.7/bin/../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.h:272 ()

http://postimg.org/image/6984ghtgb/

I've already tried reinstalling Codeblocks. I'll try the different compiler if this debugger message doesn't make sense to anyone. Thanks

Edit: I get the following from the debugger with build target as release:  http://postimg.org/image/ydtvt3bv5/
« Last Edit: July 30, 2013, 07:42:51 pm by ifconfused »

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
Anyone have any ideas?

Ivan

  • Newbie
  • *
  • Posts: 32
  • IT geek
    • View Profile
When I installed the new release 2.1 I have the same error. I fix it deleting the SFML 2.0 folder and his DLLs. Check if you have a copy of SFML libraries on Windows/System32 or a reference in Windows environment Path. Now SFML 2.1 works fine in Code::Blocks 12.1.

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
When I installed the new release 2.1 I have the same error. I fix it deleting the SFML 2.0 folder and his DLLs. Check if you have a copy of SFML libraries on Windows/System32 or a reference in Windows environment Path. Now SFML 2.1 works fine in Code::Blocks 12.1.

What exactly do you mean here?

Ivan

  • Newbie
  • *
  • Posts: 32
  • IT geek
    • View Profile
Simply, if you have a previous SFML version installed, delete it and this DLLs where you are placed. In my case I added my SFML path on Windows Environment Path, I modified SFML-2.0 for SFML-2.1, I deleted the SFML-2.0 folder and now its work ok.

ifconfused

  • Newbie
  • *
  • Posts: 9
    • View Profile
I give up. It simply doesn't work. I've tried dozens of different things. SML here I come