Hello,
I have problem with drawing both text and sprites.
I can draw shapes without problems but when trying to draw text I'm getting following:
Unhandled exception at 0x74FCCB49 in SFML learning.exe: 0xC0000005: Access violation executing location 0x00000000.
and from the debug output
'SFML learning.exe' (Win32): Loaded 'C:\Users\Nihu\Documents\Visual Studio 2013\Projects\SFML learning\Debug\SFML learning.exe'. Symbols loaded.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Users\Nihu\Documents\Visual Studio 2013\Projects\SFML learning\Debug\sfml-graphics-d-2.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Users\Nihu\Documents\Visual Studio 2013\Projects\SFML learning\Debug\sfml-window-d-2.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Users\Nihu\Documents\Visual Studio 2013\Projects\SFML learning\Debug\sfml-system-d-2.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Users\Nihu\Documents\Visual Studio 2013\Projects\SFML learning\Debug\sfml-audio-d-2.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Users\Nihu\Documents\Visual Studio 2013\Projects\SFML learning\Debug\openal32.dll'. Module was built without symbols.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Users\Nihu\Documents\Visual Studio 2013\Projects\SFML learning\Debug\libsndfile-1.dll'. Module was built without symbols.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nvoglv32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Wldap32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file.
The thread 0x80 has exited with code 0 (0x0).
The thread 0x1038 has exited with code 0 (0x0).
'SFML learning.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\powrprof.dll'
The thread 0x12cc has exited with code 0 (0x0).
The thread 0x128c has exited with code 0 (0x0).
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dinput.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\hid.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll'
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'SFML learning.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll'
'SFML learning.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file.
First-chance exception at 0x00000000 in SFML learning.exe: 0xC0000005: Access violation executing location 0x00000000.
Unhandled exception at 0x74FCCB49 in SFML learning.exe: 0xC0000005: Access violation executing location 0x00000000.
I'm using VS2013, the correct version of .dll(debug ones). The code is from tutorials/example code in API doc.
I have no clue what is wrong and knowing life there will be easy fix but I just don't see it So I need your help
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::Font font;
if (!font.loadFromFile("arial.ttf"))
return EXIT_FAILURE;
sf::Text text("Hello SFML", font, 50);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(text);
window.display();
}
return 0;
}
}