Sign in to follow this  
rnw159

Allegro newbie who needs help (40 lines)

Recommended Posts

Well, I recently started practicing allegro, I am in one of my beginner practices and I need a bit of help. I keep getting errors like, " [Linker error] undefined reference to `_imp__screen' ". I am sure there is a basic solution but I an't find it online or in another topic. ------------------------------------------------------------------------------- My code: #include <allegro.h> #include <cstdlib> BITMAP *StickMan1; int stick_x = 20; int stick_y = 20; void SetupGame(){ draw_sprite(screen, StickMan1, stick_x, stick_y); acquire_screen(); } void MoveMan(){ if( key[KEY_RIGHT]){ --stick_x; } else if(key[KEY_LEFT]){ ++stick_x; } } int main(){ allegro_init(); install_keyboard(); set_color_depth(16); set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0); StickMan1 = load_bitmap( "StickMan1.bmp", NULL); SetupGame(); MoveMan(); return 0; } END_OF_MAIN(); ---------------------------------------------------------------------------- Like I said, its really short and probably a stupid error on my part. I use Dev C++ as my compiler and am really just a newb who needs help. Thankyou

Share this post


Link to post
Share on other sites
Usually Allegro beginners get an error due to missing graphics files but in your case I'd be it's because of your use of Dev C++ as your compiler.
Try using C++ express. It's free.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this