SFML community forums
Help => Graphics => Topic started by: no name on August 11, 2016, 12:09:37 am
-
I just upgraded to the latest version of SFML in the hopes of fixing a small problem, but it seems like I've just created a much bigger one. I was able to put sf::Text objects in vectors in the old version but now doing so causes my program to crash.
This code causes a bad_alloc error:
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
int main()
{
sf::Text t;
std::vector<sf::Text> vec;
vec.push_back(t);
return 0;
}
Pushing a sf::Sprite object into a vector of Sprites works fine. Only sf::Text is causing this issue. sizeof(sf::Text) is 260 bytes while sizeof(sf::Sprite) is 272 bytes so I don't think it has anything to do with memory shortage.
Did I install something wrong or can we not put sf::Text objects in containers?
-
This works fine for. I assume you must have some bad configuration. Do you use debug libs in release mode or release libs in debug mode? What's your compiler? What's your OS?
-
This works fine for. I assume you must have some bad configuration. Do you use debug libs in release mode or release libs in debug mode? What's your compiler? What's your OS?
Yep, problem was on my end, got it resolved (forgot to update the DLL files).
Thanks and sorry for wasting your time!