Hey, recently I've been writing a fairly small game. I wanted to start writing bits of the GUI and so I wrote a small class which just printed out some text, everything was fine and the program ran without errors (this was yesterday I wrote the class), but today however, when the program closes I keep getting a stopped responding message from Windows. I used the debugger and the errors looked like they were related to the sf::Font class and so I just removed two lines which were:
sf::Font font;
if(!font.loadFromFile("font.ttf"))
cout << "\nFailed to load a font!" << endl;
Removing these two lines removed all of the errors and the program ran smoothly again. I obviously need text for a GUI and so I'd really like to know what's going on...?
Build Log:
-------------- Clean: Debug in Game (compiler: GNU GCC Compiler)---------------
Cleaned "Game - Debug"
-------------- Build: Debug in Game (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -g -Os -std=c++0x -IC:\Users\Name\Desktop\SFML-2.0\include -Iinclude -c C:\Users\Name\Desktop\Game\Game\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\Users\Name\Desktop\SFML-2.0\lib -o bin\Debug\Game.exe obj\Debug\main.o -lsfml-system -lsfml-window -lsfml-graphics -lsfml-network -lsfml-audio
Output file is bin\Debug\Game.exe with size 804.23 KB
Process terminated with status 0 (0 minute(s), 11 second(s))
0 error(s), 0 warning(s) (0 minute(s), 11 second(s))
Debugger Log:
#0 669A1D1B FT_Done_Library() (C:\WINDOWS\SysWOW64\sfml-graphics-2.dll:??)
#1 669AA61C FT_Done_FreeType() (C:\WINDOWS\SysWOW64\sfml-graphics-2.dll:??)
#2 66981CE4 sf::Font::cleanup() () (C:\WINDOWS\SysWOW64\sfml-graphics-2.dll:??)
#3 0000000B ?? () (??:??)
#4 8F0D76C3 ?? () (??:??)
#5 691C1CFD sf::GlResource::~GlResource() () (C:\WINDOWS\SysWOW64\sfml-window-2.dll:??)
#6 8F0B630A ?? () (??:??)
#7 0028FB58 ?? () (??:??)
#8 00401413 __mingw_CRTStartup() (../mingwrt-4.0.3-1-mingw32-src/src/libcrt/crt/crt1.c:254)
#9 00401585 mainCRTStartup() (../mingwrt-4.0.3-1-mingw32-src/src/libcrt/crt/crt1.c:272)
And I get a message from Code::Blocks:
Program received signal SIGSEGV, Segmentation fault.
Computer Specs:
OS: Windows 8.1 64Bit
Compiler: GCC MinGW
Graphics Card: AMD Radeon 6600M and 6700M Series, AMD Radeon HD 6520G
The code runs fine appart from the errors, and the text displays. I've tried two different font files,re-downloaded the SFML DLL's, re-downloaded SFML and rebuilt the whole project to no avail.The SFML version I am running is the dynamic pre-compiled MinGW 4.7 version... help...? :3