Dev-C++ with Allegro
Aaron Whipple

Hey, I'm trying to get allegro working in dev-c++. I installed dev-c++, went to tools/check for updates, then installed allegro. this is my program.

#include <allegro.h>

int main() {
    allegro_init();

    allegro_exit();
    return 0;
}
END_OF_MAIN();

I get the compile error:

[Linker error] undefined reference to '_install_allegro_version_check'
[Linker error] undefined reference to 'allegro_exit
[Linker error] undefined reference to '_WinMain'
Id returned 1 exit status

From a few of the instructions I've read, I preformed all the steps correctly

LennyLen

Did you remember to link to the library?

Aaron Whipple

you cant "remember" something you didn't know in the first place :-/ I always had a package with a bat file to do all of the environment stuff for you. How do I go about linking the library?

LennyLen

In the Project menu, go to Project Options, then select the parameters tab. from there, click the "add library or object" button, then navigate to the Allegro library (most probably liballeg.a).

Rampage

gcc myprogram.c -o myprogram.exe -lalleg

LennyLen
Quote:

gcc myprogram.c -o myprogram.exe -lalleg

Which kinda defeats the purpose of using an IDE really, doesn't it. :P

Aaron Whipple

The Project Menu is Grayed out (unclickable)

Rampage

It's right, nevertheless. :P

LennyLen
Quote:

The Project Menu is Grayed out (unclickable)

Well, you do actually have to create a project first.

Aaron Whipple

I'm a bit confused about the whole project thing, but it worked... Thank you for your help. I appreciate it.

Thread #591819. Printed from Allegro.cc