Problems getting allegro to work.

This is a discussion on Problems getting allegro to work. within the Game Programming forums, part of the General Programming Boards category; Hey. I am using DevC++ 4.01 and i recently downloaded the allegro 4.0 self install exe from their site...it is ...

  1. #1
    Registered User Ion Blade's Avatar
    Join Date
    May 2002
    Posts
    35

    Angry Problems getting allegro to work.

    Hey.
    I am using DevC++ 4.01 and i recently downloaded the allegro 4.0 self install exe from their site...it is all installed and everything, but here is my problem.

    Code:
    #include <allegro.h>
    
    int main(int argc, char *argv[])
    {
      allegro_init();
      set_gfx_mode(GFX_AUTODETECT,640,480,0,0);
      install_keyboard();
      if (key[KEY_SPACE])
         exit(0);
      return 0;
    }
    the problem is right at the beginning. The linker just throws a bunch of 'undefined reference' errors at me. If i just delete everything and only leave the #include line, all it says is 'undefined reference to WinMain@16'. So i try including windows.h, and it just gives me more errors about 'redefined BITMAP BITMAP' blah blah blah.... anyone know what's wrong?
    oh and i have tried compiling both under a console project and a windows project, same errors.
    "Im going to have peaceful dreams of brackets and semicolons strapped on crucifixes, screaming for mercy" - Someone who doesn't like programming.

  2. #2
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200

    Smile Oh, I know what the problem is

    1) Go to the Project menu.

    2) Click Project Options

    3) Click Load Object files

    4) Find the Dev-C++ folder and then the LIB folder

    5) On files of type select Lib files ( *.a )

    6) Double Click liballeg.a

    7) Compile and Run
    What is C++?

  3. #3
    Registered User Ion Blade's Avatar
    Join Date
    May 2002
    Posts
    35
    problem is still there.
    "Im going to have peaceful dreams of brackets and semicolons strapped on crucifixes, screaming for mercy" - Someone who doesn't like programming.

  4. #4
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326
    After the closing brace of main put END_OF_MAIN();

    Like this:

    Code:
    int main()
    {
      //....
    }
    END_OF_MAIN();

  5. #5
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Oh yah, that too
    What is C++?

  6. #6
    Registered User Ion Blade's Avatar
    Join Date
    May 2002
    Posts
    35
    Yay, it worked...but now when i try to run the program, it says "alleg40.dll not found".... ?

    oh never mind, i got it.... i was wondering what that new Dll folder was all about. Thanks
    "Im going to have peaceful dreams of brackets and semicolons strapped on crucifixes, screaming for mercy" - Someone who doesn't like programming.

  7. #7
    Registered User red_baron's Avatar
    Join Date
    May 2002
    Posts
    274
    ¿Red Baron?

    "Imagination is more important than knowledge"
    -Albert Einstein (1879-1955)

    Check out my games!

    [code] /* dont forget code tags! */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems getting FileCopy to Work!
    By steve17 in forum C++ Programming
    Replies: 2
    Last Post: 11-09-2005, 02:23 PM
  2. Allegro Problems with Visual C++ .net 2003
    By LiNeAr in forum Game Programming
    Replies: 12
    Last Post: 10-16-2005, 06:51 PM
  3. installing and setting up Allegro
    By Emotions in forum Game Programming
    Replies: 11
    Last Post: 12-30-2004, 05:28 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 11:39 AM
  5. Allegro
    By The15th in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 09-14-2001, 03:06 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21