Jump to content
  • Advertisement
Sign in to follow this  
rnw159

Allegro newbie who needs help (40 lines)

This topic is 3093 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Actually I just figured it out...i'm an idiot, I forgot to link a LIB file in the project. Thanks for replying though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!