# Other Allegro Problems

## Recommended Posts

trey3rdgen    122
Hey everyone. I'm using Windows XP Pro with MS Visual C++ 8. I can compile allegro programs just fine, but when I try to execute them I get: "The application failed to initialize properly (0xc0150002)" Know how to fix this?

##### Share on other sites
coden4fun    100
Could you post your source code please and tell me how you setup your project? Maybe then I could try and solve the problem. I've worked in Allegro before, so I could slash it down to a couple of problems you could be doing, or not doing for that matter.

edit: tried given you the correct syntax of using copying and pasting source code in a forum if you need to see how it's done just quote this forum and look at the text below

you'll have something like this

my source code

##### Share on other sites
trey3rdgen    122
I have the platform SDK installed. I have the DirectX 9 SDK.

#include <allegro.h>

DATAFILE*data;

int main()
{
allegro_init();
set_config_file("GAMECONFIG.cfg");
install_keyboard();

if (install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL)) {
allegro_message("Sound Error: %s", allegro_error);
return 1;
}

set_volume(130,130);

return 0;
}
END_OF_MAIN();

##### Share on other sites
konForce    592
Make sure you select the MSVC runtime (Multithreaded Debug/Release DLL) that corresponds with your project build.

##### Share on other sites
trey3rdgen    122
Hmm.. I think I did it right. But if I did, it's still not working. What else should I check for?

##### Share on other sites
konForce    592
Did you build Allegro yourself or use the pre-built binaries? If you used the 4.2.2 binaries, you have to have VC++ 2005 Service Pack 1 installed.

##### Share on other sites
coden4fun    100
You haven't created any video mode, so I think I'm not 100% sure so please don't quote me, but having a similar problem like this before, and knowing what I had to do to fix this is this.

You have some allegro code and if you don't support a video mode, or initialize the video mode at all then you basically have no window, so the code that you do have, and the allegro that you have initialized goes to memeory but from their it doesn't know where to go, or what to do, for their is no display.

int ret = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);if(ret != 0){     allegro_message(allegro_error);}

Hope this helps!

##### Share on other sites
He's not really doing anything graphically so that shouldn't matter. He's got the call to allegro_init(). That's really the only essential bit.

##### Share on other sites
daviangel    604
Are you trying to run your program within the VS IDE?
If so you probably have to copy the necessary allegro dll's to your debug or release directory if you already haven't.
I know this caused me problems when I first started learning Allegro.

##### Share on other sites
trey3rdgen    122
I'm 95% sure Reinstalling my WinXP Service Pack will fix this problem. Sorry to re bring up this post, but this may help a lot of people.

Here is something I was reading: http://support.microsoft.com/kb/822520