Linking Allegro troubles
#1 Members - Reputation: 381
Posted 29 June 2012 - 12:38 AM
#include </usr/include/allegro.h> //the /usr/include/allegro.h is where allegro is on my hardrive.
int main()
{
//Initialize Allegro
allegro_init();
//Set the resolution to 640 x 480 with SAFE autodetection.
set_gfx_mode(GFX_SAFE, 640, 480, 0, 0);
//Install the keyboard handler
install_keyboard();
//Print your welcome message to the screen
textout(screen, font, "Hello Dream.In.Code! This is my first Allegro Program", 1, 1, 10);
textout(screen, font, "Press ESCape to quit.", 1, 12, 11);
//Loop until escape is pressed
while(! key[KEY_ESC])
poll_keyboard();
//Exit program
allegro_exit();
return 0;
}
END_OF_MAIN();
i get these errors:
/usr/include/allegro/alcompat.h|157|error: undefined reference to '_textmode'|
/usr/include/allegro/alcompat.h|157|error: undefined reference to 'textout_ex'|
/home/matt/C++Crap/Allegro /main.cpp|6|error: undefined reference to '_install_allegro_version_check'|
/home/matt/C++Crap/Allegro /main.cpp|9|error: undefined reference to 'set_gfx_mode'|
/home/matt/C++Crap/Allegro /main.cpp|12|error: undefined reference to 'install_keyboard'|
/home/matt/C++Crap/Allegro /main.cpp|15|error: undefined reference to 'font'|
/home/matt/C++Crap/Allegro /main.cpp|15|error: undefined reference to 'screen'|
/home/matt/C++Crap/Allegro /main.cpp|16|error: undefined reference to 'font'|
/home/matt/C++Crap/Allegro /main.cpp|16|error: undefined reference to 'screen'|
/home/matt/C++Crap/Allegro /main.cpp|20|error: undefined reference to 'poll_keyboard'|
/home/matt/C++Crap/Allegro /main.cpp|19|error: undefined reference to 'key'|
/home/matt/C++Crap/Allegro /main.cpp|23|error: undefined reference to 'allegro_exit'|
||=== Build finished: 12 errors, 0 warnings ===|
please help me!!!
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#4 Members - Reputation: 381
Posted 29 June 2012 - 10:19 PM
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#5 Members - Reputation: 114
Posted 30 June 2012 - 02:52 AM
When I worked with allegro, I used Dev-C++. There's another post here in the forum, I'll just quote what another member said:
in Dev-C++ go to the Tools menu and click Check for updates/Packages. Select a devpak server from the drop down menu and click Check for updates. You'll see a list of packages that you can download, find Allegro and check it and download it.
So that's quite easy.
Then again..
You shouldn't use Dev-C++. It's very old, extremely buggy, and will hinder the process of learning to program.
Edited by theo2005, 30 June 2012 - 03:02 AM.






