Original Post
Hello, Im trying to make an allegro game. Here is my code: Code: #include // include the basic header for allegro #include // include the basic header for c++ functions #include // include the basic header for file i/o #include // include the basic header for using strings using namespace std; // c++ specify int main() { // main function int res; // used for error handling struct scenery { // declare a struct to hold all the scenery BITMAP *spr_background; // declare a bitmap for a background BITMAP *spr_box; // declare a bitmap for a box } struct player { // declare a struct to hold all the players information BITMAP *spr_player; // declare a bitmap for a player int x, y; // players x and y coords } allegro_init(); // initialize allegro set_color_depth(32); // set the color depth res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 1280, 1024, 0, 0); // set the screen resolution if (res != 0) { // error check if setting the screen resolution failed allegro_message(allegro_error); // give the player a message exit(-1); // exit the program } install_timer(); // intialize timers in allegro install_keyboard(); // intialize keyboard routines in allegro install_mouse(); // intialize mouse routines in allegro player.spr_player = load_bitmap( "player.bmp", NULL); // load the bitmap for the player player.spr_background = load_bitmap( "background.bmp", NULL); // load the bitmap for the background player.spr_box = load_bitmap( "box.bmp", NULL); // load the bitmap for the box player.x = 300; // set some default player coordinates player.y = 300; // while (false) { // start the GAME LOOP } // end the GAME LOOP return 0; // end the program } END_OF_MAIN() // allegro specify (well commented eh?) Now I get an error when i try and compile this code: Quote: Error: Line 26 - two or more data types in declaration of 'install_allegro' Line 26 - no matching function for call to '_mangled_main()::scenery::scenery(int, int*, int(*)void(*)))" Now whats wrong with my code? Are there n e more errors u can find? - Cheers, Daniel