SFML Shapes and vectors

I'm not having much luck on the SFML forums so I decided to try asking here.

Just started messing around with SFML and I tried to make a vector of RectangleShapes. I'm able to create and use everything in the vector just fine but when I try and end the program it throws some error that looks like it is unable to free some memory. Everything works fine without the vector so I assume that's the problem.

Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <SFML/Graphics.hpp>
#include <vector>
int main()
{
    sf::RenderWindow window(sf::VideoMode(500, 500), "My window");
	std::vector <sf::RectangleShape> vectorRec(25);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
	//Use the vector of Rectangles here
        window.display();
    }
    return 0;
}


I get
Heap block at (Some memory address) modified at (Some memory address) past requested size of (something)


visual studio shows a function used to "Free a memory block in the heap" is throwing the error.

Anyone know why this is happening and how to prevent it?
Did you compile sfml or are you using a precompiled version?
pre-compiled
pre-compiled


That is likely the problem. You should compile the library yourself so you're sure it and the settings it uses are entirely compatible with your tool chain's settings and configuration.
Any advice for someone who's never done anything like that before?

Other than this http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php
Not really. The only thing you can do is just look at the documentation for your compiler, but that tutorial looks pretty good. You should really get used to compiling things from source, though. Its really quite useful, as it allows you to make bugfixes and things for things you have found, or add functionality that you want but the providers aren't going to add.
Topic archived. No new replies allowed.