SFML community forums

Help => Graphics => Topic started by: walkingwounded on November 22, 2015, 06:03:56 pm

Title: Unhandled Exception when loading a font
Post by: walkingwounded on November 22, 2015, 06:03:56 pm
I've been trying to load a font into one of my projects but I keep getting an unhandled exception. Im using visual studio 2013.

error message:
Unhandled exception at 0x639FF20C (msvcr120.dll) in Project1.exe: 0xC0000005: Access violation reading location 0x00924000.

#include <SFML\Graphics.hpp>

using namespace sf;

int main()
{
        RenderWindow window(sf::VideoMode(800, 600), "test");

        Font myFont;

        myFont.loadFromFile("arial.ttf");

        Text myText;

        myText.setFont(myFont);
        myText.setString("Test");

        while (window.isOpen())
        {
                sf::Event event;

                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed) window.close();
                }
        }

}
Title: Unhandled Exception when loading a font
Post by: eXpl0it3r on November 22, 2015, 07:20:35 pm
Ard you mixing debug and release modes or x86 and x64 architectures?
Title: Re: Unhandled Exception when loading a font
Post by: walkingwounded on November 22, 2015, 08:21:44 pm
its possible, i got a bit confused when downloading sfml. ive got other stuff working though so i'm not sure whats wrong