That's odd. I would use something like this to compile my allegro program from the command line using v5.5:
bcc32 -tW -5 -lc:\bcc55\bin\alleg.lib -etest.exe test.c
Making sure I had bcc32.cfg and ilink32.cfg in the directory, and where bcc55 is the path to my Borland compiler.
Actually, this should work for 4.5 as well (I have heard that it does).
Please try to compile this program (compile as Windows prog, not console):
// Initialize Allegro.
// Set the resolution to 640 by 480 with SAFE autodetection.
set_gfx_mode(GFX_SAFE, 640, 480, 0, 0);
// Installing the keyboard handler.
// Printing text to the screen.
textout(screen, font, "Hello World!", 1, 1, 10);
textout(screen, font, "Press ESCape to quit.", 1, 12, 11);
// Looping until the ESCape key is pressed.
poll_keyboard(); // This shouldn't be necessary in Windows.
// Exit program.
// Some Allegro magic to deal with WinMain().
Hope you have better luck with that example. I'm going to try getting it to work with 4.5 and let you know if and how I was successful. Sorry, I'm not able to be online very often lately, but I'll try to respond as quickly as possible.