Other Allegro Problems
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?
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
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
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();
#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();
Make sure you select the MSVC runtime (Multithreaded Debug/Release DLL) that corresponds with your project build.
Hmm.. I think I did it right. But if I did, it's still not working. What else should I check for?
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.
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.
So try adding
Hope this helps!
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.
So try adding
int ret = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);if(ret != 0){ allegro_message(allegro_error);}
Hope this helps!
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement