Need help with Allegro 5 & Visual C++

Started by
6 comments, last by Endurion 12 years, 2 months ago
Hello everyone,

I ran into a little bit of trouble while trying to get allegro 5 to work with Visual C++. The problem I'm having is that when I compile&debug my project, the only thing that appears is a black screen that lasts for 5 seconds and then dissapears again. Strange thing is; I can actually -see- the minimized window of the thing I'm trying to compile, but I can't get it to -pop up- if you know what I mean.

I hope someone can help me out with this. This is really driving me insane :s
Advertisement
If you want your car repaired, do you walk to your mechanic and tell them about the noises the car makes?

Show code.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

The code I want to compile comes from a tutorial(http://fixbyproximit...fonts-and-text/). I'm still very new to Allegro 5, though I have worked with C++ a little before:


#include <allegro5\allegro.h>
#include <allegro5\allegro_font.h>
#include <allegro5\allegro_ttf.h>
#include <allegro5\allegro_native_dialog.h>
int main(void)
{
ALLEGRO_DISPLAY *display = NULL;
if(!al_init())
{
al_show_native_message_box(NULL, NULL, NULL, "failed to initialize allegro!", NULL, NULL);
return -1;
}
display = al_create_display(640, 480);
if(!display)
{
al_show_native_message_box(NULL, NULL, NULL, "failed to initialize display!", NULL, NULL);
return -1;
}
al_init_font_addon();
al_init_ttf_addon();
ALLEGRO_FONT *font24 = al_load_font("arial.ttf", 24, 0);
al_clear_to_color(al_map_rgb(0,0,0));
al_draw_text(font24, al_map_rgb(255, 0, 255), 50, 50, 0, "Hello World. Please work");
al_flip_display();
al_rest(5.0);
al_destroy_display(display);
return 0;
}


My debug console shows:
'AllegroTest.exe': Loaded 'C:\allegroDev\AllegroTest\Debug\AllegroTest.exe', Symbols loaded.
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\allegro-5.0.5-monolith-md-debug.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7600.16385_none_72fc7cbf861225ca\GdiPlus.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\comdlg32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16661_none_ebfb56996c72aefc\comctl32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\d3d9.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\d3d8thk.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\nvd3dum.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\oleacc.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\powrprof.dll', Cannot find or open the PDB file
'AllegroTest.exe': Unloaded 'C:\Windows\SysWOW64\powrprof.dll'
The thread 'Win32 Thread' (0xab4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x153c) has exited with code 0 (0x0).
'AllegroTest.exe': Unloaded 'C:\Windows\SysWOW64\nvd3dum.dll'
'AllegroTest.exe': Unloaded 'C:\Windows\SysWOW64\d3d9.dll'
'AllegroTest.exe': Unloaded 'C:\Windows\SysWOW64\d3d8thk.dll'
The program '[1476] AllegroTest.exe: Native' has exited with code 0 (0x0).


Though I wouldn't know if this is relevant at all. I'm really inexperienced with this stuff >.<

http://imageshack.us...groproblem.jpg/
I'm by no means an expert but I've gone through the tutorials at fixybyproximity as well. Hit me up if you ever get stuck.

I believe your problem might be this:

1) Make sure you have included allegro-5.0.5-monolith-md.lib in your Linker Input settings.
2) Make sure you have incuded the file arial.ttf in your project folder.

I compiled your code and it worked fine after doing these two things.
Glad to see you found my site. Let's see if I can't help.

First, are you using 32 or 64 bit windows? Secondly, did you place your dll's in system32 (32-bit) or sysWOW64 (64-bit)? That error indicates that your computer cannot find the dll's. Go into the appropriate folder and look for the files manually to ensure that they are there.
Thanks for the help everyone :) I really appreciate it.

I've looked through my dll folder ( I've got the 64 bit version of windows ) and everything seems to be in order. However, The problem still persists. I've also double checked the linker settings and the place where I kept my arial font. No matter what I try though, it keeps giving the same problem.

Now, the strange thing is, eventually I tried using different code ( one from Mike's later tutorials ), and it gives exactly the same problem! I tried reinstalling visual studio, following the first tutorial again step by step to make sure I didn't miss anything and it still doesn't seem to work. I've even tried using another IDE ( dev c++ ) to get it to work, but that didn't seem to like me too much either.

Eventually I thought it might've been a symbol problem ( Since that's the error it's giving ), so I tried solving that by activating the microsoft symbol servers in debug -> options -> symbols. It gave the following result:
'AllegroTest.exe': Loaded 'C:\allegroDev\AllegroTest\Debug\AllegroTest.exe', Symbols loaded.
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\allegro-5.0.5-monolith-md.dll', Binary was not built with debug information.
'AllegroTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7600.16385_none_72fc7cbf861225ca\GdiPlus.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\comdlg32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16661_none_ebfb56996c72aefc\comctl32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\d3d9.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\d3d8thk.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\nvd3dum.dll', Cannot find or open the PDB file
'AllegroTest.exe': Loaded 'C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\oleacc.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\powrprof.dll', Symbols loaded (source information stripped).
'AllegroTest.exe': Unloaded 'C:\Windows\SysWOW64\powrprof.dll'
The thread 'Win32 Thread' (0x15f4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1e40) has exited with code 0 (0x0).
'AllegroTest.exe': Unloaded 'C:\Windows\SysWOW64\nvd3dum.dll'
'AllegroTest.exe': Unloaded 'C:\Windows\SysWOW64\d3d9.dll'
'AllegroTest.exe': Unloaded 'C:\Windows\SysWOW64\d3d8thk.dll'
The program '[7680] AllegroTest.exe: Native' has exited with code 0 (0x0).


It still seems to have trouble with: 'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\nvd3dum.dll', Cannot find or open the PDB file
But it's loading the rest. You guys think this might be the problem I'm facing? Since it's -still- not working.

Sorry if I seem a little inexperienced with this kind of stuff, because I am :P. I've mainly worked with Actionscript 3.0 before I tried this out. Though I've also tried doing something with C# XNA & Unity before.

A couple of screenshots I've taken while trying to resolve the problem:
http://imageshack.us/f/607/allegroproblamz.jpg/
I noticed this line:
'AllegroTest.exe': Loaded 'C:\Windows\SysWOW64\allegro-5.0.5-monolith-md.dll', Binary was not built with debug information.

In your linker, what "additional dependencies" are you using? You should use:

allegro-5.0.5-monolith-md-debug.lib (notice the debug word, are you missing it)?
Completely besides that: The years of copying DLLs in system folders are long gone. Those years were called DLL hell, and it happened, because people did copy DLLs there.

YOU SHOULD NOT DO THAT. Allegro is not a system library, so keep them in your game folder.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

This topic is closed to new replies.

Advertisement