SFML community forums

Help => Graphics => Topic started by: wormpattern on October 21, 2012, 07:58:22 pm

Title: [sf::Font] Memory violation
Post by: wormpattern on October 21, 2012, 07:58:22 pm
Hello,

I am getting memory access error while trying to run code (SFML 2.0):

sf::Font font;
font.loadFromFile("arial.ttf");

Unhandled exception at 0x6d5a1f16 in test.exe: 0xC0000005: Access violation reading location 0x003b2000.

from debugger:
+      font   {m_library=0xbaadf00d m_face=0xbaadf00d m_streamRec=0xbaadf00d ...}   sf::Font

font file is present and accessible.

Any idea on it?

Title: Re: [sf::Font] Memory violation
Post by: Laurent on October 21, 2012, 08:27:27 pm
Which compiler?

If VC++11 (Visual Studio2012), have you recompiled SFML?
Title: Re: [sf::Font] Memory violation
Post by: wormpattern on October 21, 2012, 08:36:25 pm
Hello, its VS 2010 express. I didnt recompile it actualy, just took as it is.
Title: Re: [sf::Font] Memory violation
Post by: Laurent on October 21, 2012, 09:45:38 pm
Are you sure that you're not mixing static/dynamic, or debug/release? Can you show a complete and minimal code that reproduces the problem?
Title: Re: [sf::Font] Memory violation
Post by: wormpattern on October 21, 2012, 11:41:15 pm
Hello,

You are absolutly right I didnt used static libs. My fault and thanks for help.
Title: Re: [sf::Font] Memory violation
Post by: Laurent on October 22, 2012, 08:57:25 am
"Not using the static libs" is not a mistake ???