|
From: neo <de...@ey...> - 2003-12-03 10:30:51
|
I downloaded the allegro through WebUpdate Module,and installed it,but there
is a problem when i tried compiling the example program named exhello.c.the
code of the example program as below:
/************************************************************************/
#include "allegro.h"
int main()
{
/* you should always do this at the start of Allegro programs */
allegro_init();
/* set up the keyboard handler */
install_keyboard();
/* set a graphics mode sized 320x200 */
if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) {
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
allegro_message("Unable to set any graphic mode\n%s\n",
allegro_error);
return 1;
}
/* set the color palette */
set_palette(desktop_palette);
/* clear the screen to white */
clear_to_color(screen, makecol(255, 255, 255));
/* you don't need to do this, but on some platforms (eg. Windows) things
* will be drawn more quickly if you always acquire the screen before
* trying to draw onto it.
*/
acquire_screen();
/* set transparent text */
text_mode(-1);
/* write some text to the screen with black letters */
textout_centre(screen, font, "Hello, world!", SCREEN_W/2, SCREEN_H/2,
makecol(0,0,0));
/* you must always release bitmaps before calling any input functions */
release_screen();
/* wait for a keypress */
readkey();
return 0;
}
END_OF_MAIN();
/****************************end*****************************************/
the error information(devcpp):
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\My Documents\Untitled1.c" -o "C:\My Documents\Untitled1.exe"
-I"D:\DEV-CPP\include" -L"D:\DEV-CPP\lib"
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x4f):Untitled1.c: undefined reference to
`install_allegro'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x57):Untitled1.c: undefined reference to
`install_keyboard'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x72):Untitled1.c: undefined reference to
`set_gfx_mode'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x8b):Untitled1.c: undefined reference to
`set_gfx_mode'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x97):Untitled1.c: undefined reference to
`_imp__allegro_error'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0xa1):Untitled1.c: undefined reference to
`allegro_message'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0xb9):Untitled1.c: undefined reference to
`_imp__desktop_palette'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0xbe):Untitled1.c: undefined reference to
`set_palette'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0xdb):Untitled1.c: undefined reference to
`makecol'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0xe4):Untitled1.c: undefined reference to
`_imp__screen'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0xeb):Untitled1.c: undefined reference to
`clear_to_color'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0xf3):Untitled1.c: undefined reference to
`acquire_screen'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0xfd):Untitled1.c: undefined reference to
`text_mode'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x111):Untitled1.c: undefined reference to
`makecol'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x11a):Untitled1.c: undefined reference to
`_imp__gfx_driver'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x124):Untitled1.c: undefined reference to
`_imp__gfx_driver'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x14a):Untitled1.c: undefined reference to
`_imp__gfx_driver'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x154):Untitled1.c: undefined reference to
`_imp__gfx_driver'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x17f):Untitled1.c: undefined reference to
`_imp__font'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x186):Untitled1.c: undefined reference to
`_imp__screen'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x18d):Untitled1.c: undefined reference to
`textout_centre'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x195):Untitled1.c: undefined reference to
`release_screen'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x19a):Untitled1.c: undefined reference to
`readkey'
C:\WINDOWS\TEMP/ccqHlhgb.o(.text+0x1c5):Untitled1.c: undefined reference to
`_WinMain'
Execution terminated
who can help me ?thx anyway!
--http://www.eyou.com
--Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ ÒÆ¶¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢...ÒÚÓÊδ¾¡
--http://vip.eyou.com
--¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû
|