Public Group

Newbie cant compile Allegro files

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

Recommended Posts

Hello guys!

Well I bought a Game programming book which uses the C language and Allegro. Im studying programming in uni right now, im fairly familiar with C/Java/C++.
I cant get this simple "Hello World!" program to work, I get a few compile errors, that I cant quite figure out. I have done everything the book says, yet I cant get it to work. Im using Dev-C++, that might be it, Im not sure. Ive tried installing allegro in 2 different ways, 1 being how the book explained, and the other one is by the tools tab in dev-c++ -> update -> download it lol.

#include<allegro.h> int main(void) { allegro_init(); set_gfx_mode(GFX_SAFE, 640, 480, 0, 0); install_keyboard(); textout_ex(screen, font,"Hello World!",1, 1, 10, -1); while(!key[KEY_ESC]); allegro_exit(); return 0; } 

 Thats the hello world, and here are the compile errors im getting: .drectve -aligncomm:"___DTOR_LIST__",2 ' unrecognized .drectve -aligncomm:"___CTOR_LIST__",2' unrecognized [Linker error] undefined reference to WinMain@16' ld returned 1 exit status C:\Users\Ali\Desktop\testing\Makefile.win [Build Error] [Project1.exe] Error 1`

Share on other sites
Thank you! I cant believe I missed that, lol.

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• Forum Statistics

• Total Topics
633732
• Total Posts
3013584
×