delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/03/17/05:19:01

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-ID: <002901c1cd9d$0fa1b520$20ed5ecb@u4v4b7>
From: "Amish K. Munshi" <amishmunshi AT yahoo DOT com>
To: <djgpp AT delorie DOT com>
Subject: Allegro
Date: Sun, 17 Mar 2002 15:40:41 +0530
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Reply-To: djgpp AT delorie DOT com

Hi,

    When I try to compile the program

#include <stdio.h>
#include <allegro.h>

int main()
 {
  BITMAP *bmp;
  int mode;


  mode = allegro_init();

  set_color_depth(8);
  mode = set_gfx_mode(GFX_AUTODETECT,1024,768,0,0);
  bmp = create_bitmap(640,480);
  clear(bmp);
  putpixel(bmp,100,100,5);
  vline(bmp,100,200,400,5);
  blit(bmp,screen,0,0,0,0,1024,768);
  scanf("%i",&mode);
  blit(screen,bmp,0,0,0,0,1024,768);
  destroy_bitmap(bmp);
  return 0;
 }


        using the following command

gcc -lalleg test.c -o test.exe

the output is c:\djgpp\bin\ld.exe: cannot open -lalleg: No such file or
directory (ENOENT)

and when I try to compile using the command

gcc -o test.exe test.c

 the output is undefined reference to allegro_init   set_color   and all the
graphics related commands.

    What am I doing wrong the autoexec.bat file is as follows

PATH="d:\tc\bin;c:\tc\bgi;c:\djgpp\contrib\bcc2grx\src;C:\windows;C:\Program
Files\Mts;c:\jdk\bin;c:\windows\command;C:\DJGPP\BIN"
SET DJGPP=C:\DJGPP\DJGPP.ENV
C:\MediaKey\FGetKey.exe



And the file DJGPP.ENV has the following.


#= Don't edit this line unless you move djgpp.env outside
#= of the djgpp installation directory.  If you do move
#= it, set DJDIR to the directory you installed DJGPP in.
#=
DJDIR=%:/>DJGPP%

+USER=dosuser
+GROUP=root
+TMPDIR=%DJDIR%/tmp
+EMU387=%DJDIR%/bin/emu387.dxe
+LFN=n
+TEXMFMAIN=%DJDIR%/share/texmf

[bison]
BISON_HAIRY=%DJDIR%/lib/bison.hai
BISON_SIMPLE=%DJDIR%/lib/bison.sim

[cpp]
CPLUS_INCLUDE_PATH=%/>;CPLUS_INCLUDE_PATH%%DJDIR%/lang/cxx;%DJDIR%/include
C_INCLUDE_PATH=%/>;C_INCLUDE_PATH%%DJDIR%/include
OBJCPLUS_INCLUDE_PATH=%/>;OBJCPLUS_INCLUDE_PATH%%DJDIR%/include;%DJDIR%/lang
/objc
OBJC_INCLUDE_PATH=%/>;OBJC_INCLUDE_PATH%%DJDIR%/include;%DJDIR%/lang/objc

[gcc]
COMPILER_PATH=%/>;COMPILER_PATH%%DJDIR%/bin
LIBRARY_PATH=%/>;LIBRARY_PATH%%DJDIR%/lib

[info]
INFOPATH=%/>;INFOPATH%%DJDIR%/info;%DJDIR%/gnu/emacs/info
+INFO_COLORS=0x1f.0x31
+INFO_LINES=40

[emacs]
INFOPATH=%/>;INFOPATH%%DJDIR%/info;%DJDIR%/gnu/emacs/info

[less]
+LESSBINFMT=*k<%%X>
+LESSCHARDEF=8bcccbcc12bc5b95.b127.b
LESS=%LESS% -h5$y5$Dd2.0$Du14.0$Ds4.7$Dk9.0$
+LESSSEPARATOR=/

[ispell]
+ISPELL_HOME=%DJDIR%/lib
+ISPELL_DICTDIR=%DJDIR%/lib
+ISPELL_COLORS=0x1e.0x74
+LINES=40

[locate]
+LOCATE_PATH=%DJDIR%/lib/locatedb.dat

[ls]
+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31
:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=0
1;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:
*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl
=01;37:*.dl=01;37:*~=08:*.bak=08:
[dir]
+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31
:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=0
1;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:
*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl
=01;37:*.dl=01;37:*~=08:*.bak=08:
[vdir]
+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31
:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=0
1;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:
*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl
=01;37:*.dl=01;37:*~=08:*.bak=08:

[enscript]
ENSCRIPT_LIBRARY=%DJDIR%/share/enscript

[bash]
PATH=%/>PATH%

[sh]
PATH=%/>PATH%

[groff]
+GROFF_TMAC_PATH=.;%DJDIR%/share/groff/tmac
+GROFF_TYPESETTER=ascii
+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

[eqn]
+GROFF_TMAC_PATH=.;%DJDIR%/share/groff/tmac
+GROFF_TYPESETTER=ascii

[grodvi]
+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

[grolj4]
+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

[grops]
+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font
+GROFF_TMPDIR=%DJDIR%/tmp

[grotty]
+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

[indxbib]
+GROFF_EIGN=%DJDIR%/share/groff/eign

[lkbib]
+REFER=%DJDIR%/share/Ind

[refer]
+REFER=%DJDIR%/share/Ind
+GROFF_TMPDIR=%TMPDIR%

[troff]
+GROFF_TMAC_PATH=.;%DJDIR%/share/groff/tmac
+GROFF_TYPESETTER=ascii
+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

[gawk]
+AWKPATH=.;%DJDIR%/share/awk

[awk]
+AWKPATH=.;%DJDIR%/share/awk

[man]
MANPATH=%/>MANPATH%;%DJDIR%/man;%DJDIR%/info
PAGER=%DJDIR%/bin/less.exe











                Please let me know how to compile the basic graphic program.

Bye.



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019