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

Author Topic: SFML Crashes  (Read 3005 times)

0 Members and 1 Guest are viewing this topic.

Erikpetrov

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Greedy Truck
    • Email
SFML Crashes
« on: July 07, 2013, 12:01:41 pm »
Hello, everybody.
I am new to SFML.I have problem with it.
My problem is when i try to compile and run it crashes.I use Code::Blocks (MinGW).
My executable code is the example from the main sfml site.I did all things for example:sfml-system.........and so on.I did the directories things.i copied and pasted the graphics and other .dll files.Please help me to solve this problem.
Thank in advance.
Game: Greedy Truck
Website: http://greedytruck.tk/
Location: Earth(for now)

jacob

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML Crashes
« Reply #1 on: July 07, 2013, 04:07:26 pm »
Linking libraries to the wrong build target is the only thing I know of that can cause crashes from that tutorial. Make sure that you are only linking sfml-xxxx under release and sfml-xxxx-d under debug. Also make sure they are in the correct order (sfml-graphics, sfml-window, sfml-system from top to bottom).

Be sure to read all of the text on the tutorial pages because they often mention problems you may have and how to fix them.

Erikpetrov

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Greedy Truck
    • Email
Re: SFML Crashes
« Reply #2 on: July 07, 2013, 04:43:22 pm »
This is screenshots of my settings:
1. http://prikachi.com/images.php?images/101/6305101k.png
2. http://prikachi.com/images.php?images/103/6305103K.png
3. http://prikachi.com/images.php?images/109/6305109V.png
4. http://prikachi.com/images.php?images/111/6305111g.png
This is the source code of the example tutorial:
#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;
}
 
That's all the thing that i am changing from the default.
For more information:
My Code::Blocks from herehttp://sourceforge.net/projects/codeblocks/files/Binaries/12.11/Windows/codeblocks-12.11mingw-setup.exe/download.This one : codeblocks-12.11mingw-setup.exe
SFML from herehttp://www.sfml-dev.org/download/sfml/2.0/SFML-2.0-windows-gcc-4.7-mingw-32bits.zip.That one : GCC 4.7 MinGW (DW2) - 32 bits.
« Last Edit: July 07, 2013, 04:50:59 pm by Erikpetrov »
Game: Greedy Truck
Website: http://greedytruck.tk/
Location: Earth(for now)

jacob

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML Crashes
« Reply #3 on: July 07, 2013, 05:14:02 pm »
Code::Blocks actually ships with SJLJ version of GCC/MinGW so you will want to download the GCC 4.7 TDM (SJLJ) package instead of the MinGW (DW2). This is documented in the tutorial in the first red box though the downloads page doesn't really help in making it less confusing. People make this mistake a lot.

Erikpetrov

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Greedy Truck
    • Email
Re: SFML Crashes
« Reply #4 on: July 07, 2013, 05:59:46 pm »
It still crashes i don't know what is the problem.Please add me on skype:lorddrark4754.
Game: Greedy Truck
Website: http://greedytruck.tk/
Location: Earth(for now)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: SFML Crashes
« Reply #5 on: July 07, 2013, 07:11:22 pm »
No, I don't think anyone will add you on Skype. We've been able to fix way more complex problems here on the forum, so you should do what people tell you to and come back with the results. Also since you seem to have problems with setting up your development environment, you might want to start with something more basic than SFML and read up on, how compilers and linkers work and what those "libraries" actually are and do, since this is very important.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything