Recent

Author Topic: Unit graph issue  (Read 3624 times)

p.barton@twgs.qld.edu.au

  • Newbie
  • Posts: 4
Unit graph issue
« on: August 28, 2012, 02:00:06 am »
Hi,
Trying to get Lazarus to run the "graph" unit in Pascal - uses graph;

Works just fine when installed on my laptop but when installing onto our school network get this message:
C:\Users\bartp\AppData\Local\Temp\project1.lpr(1,1) Fatal: Can't find unit Graph used by UsingGraphics

I'm guessing it is something to do with the path of the graph unit.  Any suggestions?

Sample code I'm running to check if graphics will work below:

Program UsingGraphics;
Uses Crt,Graph;
Var GraphicsDriver, GraphicsMode:smallint;

procedure OpenGraphics;
Begin
 Writeln('Graphics Initialised.');
 GraphicsDriver := Detect;
 InitGraph(GraphicsDriver, GraphicsMode,'');
end;

procedure CloseGraphics;
begin
     CloseGraph;
     Writeln('Graphics Closed.');
End;

procedure DrawCircle;
begin
     circle(320,240,100);
end;

{MISSION CONTROL}
begin
     OpenGraphics;
     repeat
   DrawCircle
     until keypressed;
     CloseGraphics;
     readln;
end.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8310
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Unit graph issue
« Reply #1 on: August 28, 2012, 05:06:44 pm »
Quote
Can't find unit Graph used by UsingGraphics
Not related to the code, but rather your configuration. Open your fpc.cfg, ensure -Fu points to correct directories. If you use standard fpc installation, actually one value is enough:
-Fu<base fpc dir, e.g. C:\fpc or /usr/lib/fpc>/<fpc version if it exists>/units/$fpctarget/*

 

TinyPortal © 2005-2018