Dev-C++ and Allegro Help
Posted: Thu Jun 10, 2010 4:36 pm
Hello all. Im getting started with Allegro and im using Dev-C++, seeing as how it is my compiler of choice. I was following a tutorial on Allegro and C++ by Lusikkamage on youtube and I followed most of what she said to type (I shortened some comments) and I get a bunch of linker errors on compiling. This is the code I have:
Am I doing it wrong? I have already installed the DevPak of Allegro and looked for a reason for my troubles. My search gave me a few things to put into the linker and now im stuck with one main error,
Code: Select all
#include <allegro.h>
int main()
{
//Allegro Initialization
allegro_init();
install_keyboard();
install_timer();
install_mouse();
install_sound( DIGI_AUTODETECT, MIDI_AUTODETECT, 0 );
set_color_depth( 16 );
bool fullscreen = false;
if(fullscreen == true) //For fullscreen
{
set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
}
else
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
BITMAP *buffer = create_bitmap( 640, 480 );
//Main game loop
while ( !key[KEY_ESC] )
{
rectfill( buffer, 0, 0, 640, 480, makecol(255, 0, 0));
//Draw rectangle
blit( buffer, screen, 0, 0, 0, 0, 640, 480 );
clear_bitmap( buffer );
}
//Free memory of bitmap
destroy_bitmap( buffer );
return 0;
}
END_OF_MAIN();
I have no idea what Im doing wrong. Could someone please help me. And as for learning Allegro online, Im going a day after posting this to get a book.[Linker error] undefined reference to '_WinMain'