China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-06 17:13
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » djgpp Allegro compilation problem View 846 Replies 1
Original Poster Posted 2003-12-02 00:00 ·  中国 浙江 宁波 联通
银牌会员
★★★
Credits 1,001
Posts 309
Joined 2002-11-19 00:00
23-year member
UID 283
Gender Male
Status Offline
/*
* Example program for the Allegro library, by Shawn Hargreaves.
*
* This is a very simple program showing how to get into graphics
* mode and draw text onto the screen.
*/


#include "allegro.h"



int main()
{
/* you should always do this at the start of Allegro programs */
if (allegro_init() != 0)
return 1;

/* set up the keyboard handler */
install_keyboard();

/* set a graphics mode sized 320x200 */
if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {
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();

/* write some text to the screen with black letters and transparent background */
textout_centre_ex(screen, font, "Hello, world!", SCREEN_W/2, SCREEN_H/2, makecol(0,0,0), -1);

/* you must always release bitmaps before calling any input functions */
release_screen();

/* wait for a keypress */
readkey();

return 0;
}

END_OF_MAIN();

This program was provided with Allegro.
It compiles smoothly under 98.

But when compiling under DOS, this appears:
gcc -o hello.exe exhello.c -lalleg
in file include form g:/djgpp/include/allegro/base.h:25,
form g:/djgpp/include/allegro.h:25,
form exhello.c:9:
g:/djgpp/lib/gcc-lib//djgpp/3.1/include/limits.h:11:23: syslimits.h: no such file or director (ENOENT)

What is going on?
Floor 2 Posted 2003-12-02 00:00 ·  中国 浙江 宁波 联通
银牌会员
★★★
Credits 1,001
Posts 309
Joined 2002-11-19 00:00
23-year member
UID 283
Gender Male
Status Offline
Ugh, I know now. It's because DOS doesn't support long filenames.
After I loaded doslfn, it worked. ^_^


Forum Jump: