So I recently upgraded to MinGW 4.7.1 and, lo and behold, it broke my program.
The debugger suggests that the culprit is a static sf::Font object I initialize in my Interface class (from Interface.cpp):
sf::Font Interface::m_Font;
The debugger says:
#0 669815E2 sf::Font::Font() () (C:\Users\Guerric\Desktop\CREATI~1\GAME-D~1\sfml-graphics-2.dll:??)
#1 0040521E __static_initialization_and_destruction_0(__initialize_p=1, __priority=65535) (C:\Users\Guerric\Desktop\Creative Works\Game - Digitesque Prison\Interface.cpp:11)
#2 00405272 _GLOBAL__sub_I__ZN9Interface5m_AppE() (C:\Users\Guerric\Desktop\Creative Works\Game - Digitesque Prison\Interface.cpp:263)
#3 0042719A __do_global_ctors () (??:??)
#4 004010DC __mingw_CRTStartup () (??:??)
#5 00401295 mainCRTStartup () (??:??)
Any ideas on what is going wrong here?
Okay, so I just spent a while refactoring my code to get rid of crashing static variables, but now something even stranger is happening. When I try to initialize an sf::VideoMode in main(), for use in the sf::RenderWindow I declare on the next line, that initialization crashes the program.
This occurs even if I remove everything else from the program, so that my main.cpp file looks like this:
#include <SFML/Graphics.hpp>
int main()
{
sf::VideoMode GameMode = sf::VideoMode(800, 600, 32);
return 0;
}
My debugger has only this to say:
#0 691C4AF9 sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int) () (C:\Users\Guerric\Desktop\CREATI~1\GAMEEN~1\sfml-window-2.dll:??)
#1 0042C3F7 main() (C:\Users\Guerric\Desktop\Creative Works\Game Engine - Anthill\main.cpp:27)
I'm stumped. Is it possible that there are some issues with SFML 2.0 and the 4.7.1 version of MinGW?