Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Unhandled Exception when loading a font  (Read 1267 times)

0 Members and 1 Guest are viewing this topic.

walkingwounded

  • Newbie
  • *
  • Posts: 2
    • View Profile
Unhandled Exception when loading a font
« 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();
                }
        }

}

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11028
    • View Profile
    • development blog
    • Email
Unhandled Exception when loading a font
« Reply #1 on: November 22, 2015, 07:20:35 pm »
Ard you mixing debug and release modes or x86 and x64 architectures?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

walkingwounded

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Unhandled Exception when loading a font
« Reply #2 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