Recent

Author Topic: Unit Graph  (Read 10586 times)

aurquiel

  • New Member
  • *
  • Posts: 16
Unit Graph
« on: March 01, 2014, 12:23:03 am »
hello i wondering where i can find this unit (Graph) and how to install it at linux, i need it because i am doing a console program and i need to insert basic graphics.

I think be default is not installed.

Thanks

Edit i found this
http://www.freepascal.org/docs-html/rtl/graph/
« Last Edit: March 01, 2014, 12:43:04 am by aurquiel »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8421
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Unit Graph
« Reply #1 on: March 01, 2014, 02:00:09 am »
Quote
I think be default is not installed.
It is. It's part of the standard distribution since a long time ago. Check your /usr/lib/fpc/$fpcversion/units/$fpctarget/graph. If it's there, probably -Fu in your fpc.cfg needs to be modified.

aurquiel

  • New Member
  • *
  • Posts: 16
Re: Unit Graph
« Reply #2 on: March 01, 2014, 02:25:54 am »
Quote
I think be default is not installed.
It is. It's part of the standard distribution since a long time ago. Check your /usr/lib/fpc/$fpcversion/units/$fpctarget/graph. If it's there, probably -Fu in your fpc.cfg needs to be modified.

Yes it's there, but why when i call it in a program like

uses graph;

The program shows a error of compilation:

project1.lpr(3,10) Fatal: Can not find unit graph used by project1.

What do you mean when you said probably "-Fu in your fpc.cfg needs to be modified"?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8421
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Unit Graph
« Reply #3 on: March 01, 2014, 06:13:44 am »
Quote
What do you mean when you said probably "-Fu in your fpc.cfg needs to be modified"?
Please learn how the compiler works:
http://www.freepascal.org/docs-html/user/usersu10.html
http://www.freepascal.org/docs-html/user/usersu7.html#x21-280003.1.2

aurquiel

  • New Member
  • *
  • Posts: 16
Re: Unit Graph
« Reply #4 on: March 01, 2014, 07:52:18 am »
I was trying to add the path to the unit

I oppened as a root fpc.cfg that is located at /etc/fpc.cfg

Then i added this line to the file

-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/graph/

To this part of the file

# searchpath for units and other system dependent things
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/graph/
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl

But it didn't work, any clues

Leledumbo

  • Hero Member
  • *****
  • Posts: 8421
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Unit Graph
« Reply #5 on: March 01, 2014, 09:02:19 am »
You just need:
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*

In case it still doesn't work, please add -vt (also available in verbosity group of compiler option) and analyze where the compiler looks for the unit file. If you don't understand, attach the log here (messages->right click->copy all and hidden messages).

aurquiel

  • New Member
  • *
  • Posts: 16
Re: Unit Graph
« Reply #6 on: March 01, 2014, 11:00:50 am »
Here is the log, i think Lazarus never looks inside the /units/graph/ carpet for graph.ppu.

Plus i noticed that inside of that carpet i dont have a file like graph.pas lazarus search that file too.

Too big for be ateached

http://www.mediafire.com/view/fa09wsyz710jxof
« Last Edit: March 01, 2014, 11:05:43 am by aurquiel »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8421
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Unit Graph
« Reply #7 on: March 01, 2014, 05:02:30 pm »
Quote
32 Using unit path: /usr/lib/fpc/2.6.2/units/x86_64-linux/graph/
The compiler should be able to find graph.ppu and graph.o in this directory. Do you have them here? I don't have 64-bit OS to test, but if I'm not mistaken, graph unit wasn't supported under 64-bit OS. I'll try building cross binutils for x86_64-linux to test.
Quote
Plus i noticed that inside of that carpet i dont have a file like graph.pas lazarus search that file too.
That's how FPC looks for units, if it can't find the compatible .ppu, it will search for the source (.pas / .pp) and try to compile that.

EDIT: confirmed (both from fpmake source code and building it), graph unit isn't supported for x86_64-linux. However, an interface compatible replacement, ggigraph, is available. It depends on libggi library as backend.
« Last Edit: March 01, 2014, 06:10:51 pm by Leledumbo »

aurquiel

  • New Member
  • *
  • Posts: 16
Re: Unit Graph
« Reply #8 on: March 01, 2014, 10:38:12 pm »
Quote
32 Using unit path: /usr/lib/fpc/2.6.2/units/x86_64-linux/graph/
The compiler should be able to find graph.ppu and graph.o in this directory. Do you have them here? I don't have 64-bit OS to test, but if I'm not mistaken, graph unit wasn't supported under 64-bit OS. I'll try building cross binutils for x86_64-linux to test.
Quote
Plus i noticed that inside of that carpet i dont have a file like graph.pas lazarus search that file too.
That's how FPC looks for units, if it can't find the compatible .ppu, it will search for the source (.pas / .pp) and try to compile that.

EDIT: confirmed (both from fpmake source code and building it), graph unit isn't supported for x86_64-linux. However, an interface compatible replacement, ggigraph, is available. It depends on libggi library as backend.

That's why i can't compile with the unit graph my OS is Linuxmint16 XFCE4 64 Bits, the path is right.

So how i call  ggigraph just

uses ggigraph;

Leledumbo

  • Hero Member
  • *****
  • Posts: 8421
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Unit Graph
« Reply #9 on: March 02, 2014, 04:33:04 am »
Quote
So how i call  ggigraph just

uses ggigraph;
Yes, but don't forget to install libggi first. Another possibility is ptcgraph, which is based on PTCPas project. This doesn't require additional library as it access X11 framebuffer directly. The interface is the same (graph unit implementations uses the same include file for interface).

 

TinyPortal © 2005-2018