[arch-general] FreePascal doesn't see the module 'graph'
When I compile this code: program radar;
uses crt, graph;
var DriverVar, ModeVar : integer;
begin DriverVar := Detect; ModeVar := 2; InitGraph(DriverVar, ModeVar,''); SetColor(4); LineTo(100,100); end.
I get an error message: mao@mao-note-arch Pascal $ fpc radar.pas
Free Pascal Compiler version 2.6.0 [2012/01/02] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling radar.pas Fatal: Can't find unit graph used by radar Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)
Why is this happening?
2012/2/26 Abdourazak Osmanov <05rnan0ff@gmail.com>:
When I compile this code:
program radar;
uses crt, graph;
var DriverVar, ModeVar : integer;
begin DriverVar := Detect; ModeVar := 2; InitGraph(DriverVar, ModeVar,''); SetColor(4); LineTo(100,100); end.
I get an error message:
mao@mao-note-arch Pascal $ fpc radar.pas
Free Pascal Compiler version 2.6.0 [2012/01/02] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling radar.pas Fatal: Can't find unit graph used by radar Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)
Why is this happening?
1) Is 'Detect' integer? I can't tell from here. 2) Shouldn't InitGraph receive a path? See "PathToDriver" in http://www.freepascal.org/docs-html/rtl/graph/initgraph.html
1) Is 'Detect' integer? I can't tell from here.
2) Shouldn't InitGraph receive a path? See "PathToDriver" in http://www.freepascal.org/docs-html/rtl/graph/initgraph.html
No, the reason is different. This code also doesn't work: program radar;
uses crt, graph;
var DriverVar, ModeVar : integer;
begin DriverVar := 0; ModeVar := 2; end.
Same error: mao@mao-note-arch Pascal $ fpc radar.pas
Free Pascal Compiler version 2.6.0 [2012/01/02] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling radar.pas Fatal: Can't find unit graph used by radar Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)
Module 'graph' is exist: mao@mao-note-arch Pascal $ pacman -Ql fpc | grep graph
fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/Package.fpc fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ggigraph.o fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ggigraph.ppu fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/libpggigraph.a fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/libpptccrt.a fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/libpptcgraph.a fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ptccrt.o fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ptccrt.ppu fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ptcgraph.o fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ptcgraph.ppu
On Sun, Feb 26, 2012 at 08:39:05PM +0300, Abdourazak Osmanov wrote:
mao@mao-note-arch Pascal $ fpc radar.pas
Free Pascal Compiler version 2.6.0 [2012/01/02] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling radar.pas Fatal: Can't find unit graph used by radar Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)
Why is this happening?
Hello. Did you read the error message yet? It says, there's no unit graph. there is, however a package called graph, which is not associated with what you wnat from the compiler. However, I looked into things: martti@deepthought:~$ pacman -Ql fpc | grep graph fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/Package.fpc fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ggigraph.o fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ggigraph.ppu fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/libpggigraph.a fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/libpptccrt.a fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/libpptcgraph.a fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ptccrt.o fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ptccrt.ppu fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ptcgraph.o fpc /usr/lib/fpc/2.6.0/units/x86_64-linux/graph/ptcgraph.ppu After a minimum of testing I found that pascal units are stored as ".ppu" files. Then I tried this: "uses ptccrt, ptcgraph" - and it compiled. My pascal knowledge is very limited, and the first program pops away just after it is started... maybe you could wait for X keyboard events or add an endless loop. cheers! mar77i
After a minimum of testing I found that pascal units are stored as ".ppu" files. Then I tried this: "uses ptccrt, ptcgraph" - and it compiled. My pascal knowledge is very limited, and the first program pops away just after it is started... maybe you could wait for X keyboard events or add an endless loop.
Thanks! I first tried this method in the IDE, and he gave the same error. However, from the console it works! Is this a bug? And more. Writing 'ptcgraph' instead of 'graph' breaks backward compatibility with Turbo Pascal.
On 02/26/2012 02:39 PM, Abdourazak Osmanov wrote:
When I compile this code:
program radar;
uses crt, graph;
var DriverVar, ModeVar : integer;
begin DriverVar := Detect; ModeVar := 2; InitGraph(DriverVar, ModeVar,''); SetColor(4); LineTo(100,100); end.
I get an error message:
mao@mao-note-arch Pascal $ fpc radar.pas
Free Pascal Compiler version 2.6.0 [2012/01/02] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling radar.pas Fatal: Can't find unit graph used by radar Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)
Why is this happening?
Because graph does not exist in x86_64. Anyway if you want to use graph in i686 you need svgalib (from AUR), and who knows if works in these days... -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Sun, Feb 26, 2012 at 10:39 PM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Because graph does not exist in x86_64. Anyway if you want to use graph in i686 you need svgalib (from AUR), and who knows if works in these days...
Wasn't there an SDL driver for graph?
On 02/26/2012 08:45 PM, Jan Steffens wrote:
On Sun, Feb 26, 2012 at 10:39 PM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Because graph does not exist in x86_64. Anyway if you want to use graph in i686 you need svgalib (from AUR), and who knows if works in these days... Wasn't there an SDL driver for graph?
The sdlgraph, is only available in i686. There is a ggigraph, but who knos if libggi builds/works. Also there is a ptcgraph thats seems to works. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (5)
-
Abdourazak Osmanov
-
Gerardo Exequiel Pozzi
-
Jan Steffens
-
Martti Kühne
-
rafael ff1