Advertisement Jump to content
Sign in to follow this  
rnw159

Allegro newbie who needs help (40 lines)

This topic is 3181 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!