Compiling SFML with cmake

Hi!
Been trying to get SFML 2.0 working the last week.
I've tried many things and I am currently using SFML built with cmake for CodeBlocks::MinGW.

The first problems I had was that it didn't link properly, but after fixing that the problem I currently have has stuck through the reinstallations, recompilations, and different builds I've used.

As I've said, it compiles without any problem, but it crashes as soon as it launches. The code is taken from the SFML tutorial at the website. http://www.sfml-dev.org/tutorials/2.0/start-cb.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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;
}


Process terminated with status -1073741819


Some guy thought it to be smart to setup a dual boot with linux but I don't think I'm all into that atm. Going really sad and mad with this since it's really holding up the programming that I really want to do atm.
Code work's ok.

Download from:

http://www.sfml-dev.org/download/sfml/2.0/SFML-2.0-windows-gcc-4.7-tdm-32bits.zip

Unpack and copy the SFML-2.0 folder into the codeblocks folder.

Retry the tutorial.
Last edited on
Still same problem, links properly, creates an executable, but when run it instantly crashes.
most likely the problem is with your build of sfml. Im pretty sure it wasn't copiled ok, or you are using diferent settings for your project then you used for compiling your sfml.
I did'nt use cmake, Just copied over the relevent libraries into the executable folder.
My bin, debug folder has the following files in it:

executable of your code
sfml-graphics-2.dll
sfml-system-2.dll
sfml-window-2.dll

The dll's are found in:

SFML-2.0/bin
Yes, I have moved the dll files, linked to the correct libraries for both linker and compiler.
That's why it links and creates an executable.

But it instantly crashes, and I want to know why. And how to fix it.

I've tried numerous builds with the same 2 results, either it don't link because they are not comapatible with the compiler or they instantly crashes.
Last edited on
Last edited on
Are you sure it instantly crashes? Or does it crash when using an SFML thing?
It crashes when using any type of SFML. I'll post on the SFML forum tomorrow.
tried swapping the dll, no sucess.
Topic archived. No new replies allowed.