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

Author Topic: Getting Started: Runtime Crash  (Read 3731 times)

0 Members and 1 Guest are viewing this topic.

Jarzka

  • Newbie
  • *
  • Posts: 6
    • View Profile
Getting Started: Runtime Crash
« on: November 04, 2012, 04:52:38 pm »
I have read Getting started page but couldn't get SFML working properly with Code::Blocks. I can compile the test project included in the documentation but I only see the command line window crashing.

Checklist:
- I have libgcc_s_dw2-1.dll in MinGW/bin folder (and I have the latest version of MinGW installed) -> I downloaded Windows 32 bits - GCC DW2 (11.5 MB)
- SFML include/lib are added correctly to the project (sure, because I can compile the project)
- .a-files are added corectly (-d versions for debugger) and are in the follow order:
libsfml-audio.a
libsfml-network.a
libsfml-graphics.a
libsfml-window.a
libsfml-system.a

Anything else I can do? :/

upseen

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Getting Started: Runtime Crash
« Reply #1 on: November 04, 2012, 04:58:38 pm »
Make sure that the corresponding dlls (libsfml- ones) are in the same directory as the executables, since you're using the dynamic libs ;)
« Last Edit: November 04, 2012, 05:01:09 pm by upseen »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Getting Started: Runtime Crash
« Reply #2 on: November 04, 2012, 05:03:33 pm »
SFML 1.6? ATI/AMD graphics card?
Laurent Gomila - SFML developer

Jarzka

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting Started: Runtime Crash
« Reply #3 on: November 04, 2012, 05:04:37 pm »
Yes those dll's are in the same folder but the program still crashes. :/

EDIT: SFML 2.0. I have AMD graphics card. Does it matter?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Getting Started: Runtime Crash
« Reply #4 on: November 04, 2012, 05:07:15 pm »
Can you give more details about the "crash"? Have you tried with the debugger?
Laurent Gomila - SFML developer

Jarzka

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting Started: Runtime Crash
« Reply #5 on: November 04, 2012, 05:08:51 pm »
It's just a normal Windows program crash (Program has stopped working...). Code::Blocks debugger gives the following error: Program received signal SIGSEGV, Segmentation fault.

Here is the C::B project file if somebody would like to take a look at it:
https://dl.dropbox.com/u/19087490/SFML%20Template.7z
« Last Edit: November 04, 2012, 05:12:11 pm by Jarzka »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Getting Started: Runtime Crash
« Reply #6 on: November 04, 2012, 06:12:08 pm »
Quote
Code::Blocks debugger gives the following error: Program received signal SIGSEGV, Segmentation fault.
At which line? What is the call stack?
Laurent Gomila - SFML developer

Jarzka

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting Started: Runtime Crash
« Reply #7 on: November 04, 2012, 06:18:11 pm »
Call stack:
#0 6E182B85   sf::VideoMode::VideoMode(this=0xc8, modeWidth=200, modeHeight=32, modeBitsPerPixel=2) (D:\developpement\sfml-master\src\SFML\Window\VideoMode.cpp:50)
#1 00401424   main() (main.cpp:7)

Error message:
Program received signal SIGSEGV, Segmentation fault.
In sf::VideoMode::VideoMode (this=0xc8, modeWidth=200, modeHeight=32, modeBitsPerPixel=2) at D:\developpement\sfml-master\src\SFML\Window\VideoMode.cpp:50 ()

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Getting Started: Runtime Crash
« Reply #8 on: November 04, 2012, 06:31:34 pm »
Can we see the corresponding code?

Are you sure that you have a DW2 gcc? The one which is shipped with Code::Blocks is a SJLJ one.
Laurent Gomila - SFML developer

Jarzka

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting Started: Runtime Crash
« Reply #9 on: November 04, 2012, 06:36:31 pm »
I linked the project already in the previous post? The main.cpp is the same you introduced in the Getting started tutorial (I only added using namespace sf).
Quote
#include <SFML/Graphics.hpp>

using namespace sf;

int main()
{
    RenderWindow window(VideoMode(200, 200), "SFML works!");
    CircleShape shape(100.f);
    shape.setFillColor(Color::Green);

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

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}


I wanted to use C++11 and that's why I downloaded C::B without compiler and then I seperately downloaded MinGW. And there is the libgcc_s_dw2-1.dll file in MinGW/bin.
« Last Edit: November 04, 2012, 06:39:23 pm by Jarzka »

Jarzka

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Getting Started: Runtime Crash
« Reply #10 on: November 04, 2012, 06:58:23 pm »
By the way I can't even run the example files found from SFML-2.0-rc\examples\shader. I start the exe file but nothing happens. :o