Allegro 5 problems

*NOTE THIS IS IN VC2010;
I have been recently trying my luck with allegro 5 and, although simple code works, even drawing and moving primitives, more complex things, or even loading fonts, give me a really annoying error when I debug. I researched the error and it said it was due to a pointer pointing towards something unexistant or NULL but I can't figure it out.
This is the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <allegro5\allegro.h>
#include <allegro5\allegro_native_dialog.h>
#include <allegro5\allegro_ttf.h>
#include <allegro5\allegro_font.h>

#define screenWidth 800
#define screenHeight 600
int main()
{
	ALLEGRO_DISPLAY * display;

	const float FPS = 60.0;

	if (!al_init())
	{
		al_show_native_message_box(NULL, "Error", NULL, "Could not initialize Whack-a-Squirrel properly", NULL, NULL);
	    
	}

	al_set_new_display_flags(ALLEGRO_WINDOWED);
	display = al_create_display(screenWidth, screenHeight);
	al_set_window_position (display, 200, 200);
	al_set_window_title (display, "Whack-a-Squirrel");

	if (!display)
	{
		al_show_native_message_box(NULL, "Error", NULL, "Failed to initialize the game", NULL, NULL);
		return -1;
	}

	al_init_font_addon();
	al_init_ttf_addon();

	ALLEGRO_FONT  *font = al_load_font("Orbitron Black.ttf", 36, NULL);
	al_draw_text(font, al_map_rgb(44, 117, 255), screenWidth / 2, screenHeight / 2, ALLEGRO_ALIGN_CENTRE, " Test Screen ");

	
	al_flip_display();
	al_rest(10.0);
	al_destroy_font(font);
	al_destroy_display(display);
	return 0;
}


I recieve this error :

 
Unhandled exception at 0x0fb2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.


And I can only break, continue at which point I keep pressing for ever or ignore which is greyed out.

Last edited on
**NOTE: This is the debug output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'ProjectTest.exe': Loaded 'C:\projects\programming\windows\c++\code\gameclub\test\ProjectTest\Release\ProjectTest.exe', Symbols loaded.
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\allegro-5.0.7-monolith-md.dll', Binary was not built with debug information.
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\psapi.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7600.17007_none_72f44f3186198a88\GdiPlus.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\comdlg32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16661_none_ebfb56996c72aefc\comctl32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\msvcr100.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\nvinit.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\d3d9.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\d3d8thk.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\igdumdx32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\igdumd32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\powrprof.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file
First-chance exception at 0x53b0c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x53b0c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
The program '[5504] ProjectTest.exe: Native' has exited with code -1073741819 (0xc0000005).


*EDIT: I reloaded the symbols in the debugger and now I get this :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'ProjectTest.exe': Loaded 'C:\projects\programming\windows\c++\code\gameclub\test\ProjectTest\Release\ProjectTest.exe', Symbols loaded.
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\ntdll.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\kernel32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\KernelBase.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\allegro-5.0.7-monolith-md.dll', Binary was not built with debug information.
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\psapi.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\ole32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\msvcrt.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\gdi32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\user32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\advapi32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\sechost.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\rpcrt4.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\sspicli.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\cryptbase.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\lpk.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\usp10.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\shlwapi.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\winmm.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\shell32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7600.17007_none_72f44f3186198a88\GdiPlus.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\comdlg32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16661_none_ebfb56996c72aefc\comctl32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\opengl32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\glu32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\ddraw.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\dciman32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\setupapi.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\cfgmgr32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\oleaut32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\devobj.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\dwmapi.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\msvcr100.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\imm32.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\msctf.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\nvinit.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\d3d9.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\version.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\d3d8thk.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\igdumdx32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\igdumd32.dll', Cannot find or open the PDB file
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\powrprof.dll', Symbols loaded (source information stripped).
'ProjectTest.exe': Loaded 'D:\Windows\SysWOW64\clbcatq.dll', Symbols loaded (source information stripped).
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x0fe2c11f in ProjectTest.exe: 0xC0000005: Access violation reading location 0x00000008.
The program '[6392] ProjectTest.exe: Native' has exited with code -1073741819 (0xc0000005).
Topic archived. No new replies allowed.