[fpc-pascal]Problems with the GRAPH Unit

Daniel GrĂ¼n daniel_gruen at web.de
Sun Feb 3 14:40:01 CET 2002


Hi!

I've got problems compiling Pascal applications using the GRAPH unit. SVGALIB 
and SVGALIB-DEVEL are installed on my Mandrake Linux system.
Trying to compile the first example program in the GRAPH-Unit-Documentation 
for Linux I get the following error:

Free Pascal Compiler version 1.0.4 [2001/05/22] for i386
Copyright (c) 1993-2000 by Florian Klaempfl
Target OS: Linux for i386
Compiling inigraph1.pas
inigraph1.pas(5,13) Note: Local variable LO not used
inigraph1.pas(5,17) Note: Local variable HI not used
inigraph1.pas(6,4) Note: Local variable FOUND not used
Assembling inigraph1
Linking inigraph1
/usr/lib/libvga.a(mouse.o): In function `ms_init':
mouse.o(.text+0x6b5): undefined reference to `pow'
inigraph1.pas(33) Warning: Error while linking
Closing script ppas.sh
32 Lines compiled, 0.1 sec

I get the same message (well, only the error while linking is the same) with 
all console-vga-graphic Pascal sourcodes I'm trying to compile. 
inigraph1.pas(33) is the line below "end.". The sourcecode 
is:

Program inigraph1; { Program to demonstrate static graphics mode selection } 
uses graph; 
const
  TheLine = 'We are now in 640 x 480 x 256 colors!'+
            ' (press <Return> to continue)'; 
var
  gd, gm, lo, hi, error,tw,th: integer;
  found: boolean; 
begin
  { We want an 8 bit mode }
  gd := D8bit;
  gm := m640x480;
  initgraph(gd,gm,'');
  { Make sure you always check graphresult! }
  error := graphResult;
  if (error <> grOk) Then
    begin
    writeln('640x480x256 is not supported!');
    halt(1)
    end;
  { We are now in 640x480x256 }
  setColor(cyan);
  rectangle(0,0,getmaxx,getmaxy);
  { Write a nice message in the center of the screen }
  setTextStyle(defaultFont,horizDir,1);
  tw:=TextWidth(TheLine);
  th:=TextHeight(TheLine); 
  outTextXY((getMaxX - TW) div 2,
            (getMaxY - TH) div 2,TheLine);
  { Wait for return }
  readln;
  { Back to text mode }
  closegraph;
end.

I didn't find anything helpful yet.

Daniel Gruen





More information about the fpc-pascal mailing list