Recent

Author Topic: Adding Units to FPC from GitHub  (Read 4825 times)

Mark92630

  • New Member
  • *
  • Posts: 15
Adding Units to FPC from GitHub
« on: March 30, 2015, 06:59:45 pm »
Mac OS X 10.10 (Yosemite), with fpc (2.6.4), fpcsrc, and Lazarus (1.2.6) installed.

I have not been using Lazarus, because the learning curve with Lightweight-IDE looks a LOT less steep.

Anyway, I've been writing some elementary programs in fpc (using Lightweight-IDE), and they mostly work just fine. Now, I want to add some code from GitHub to my existing Pascal environment, namely "generics.collections" from "dathox", and I have no idea how to do it. There are no installation instructions for this on GitHub.

Can anyone help?

TIA,

Mark

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Adding Units to FPC from GitHub
« Reply #2 on: March 30, 2015, 07:05:00 pm »
You'll need to install trunk version of FPC for that.

Then get the files on your harddrive.
make sure fpc has the search path set up to (-Fu%thepathwherefilesare%)

the added generics.collections to your uses section
Code: [Select]
uses ... generics.collections

Mark92630

  • New Member
  • *
  • Posts: 15
Re: Adding Units to FPC from GitHub
« Reply #3 on: March 30, 2015, 07:39:56 pm »
So, now I have multiple questions, but I will take them one at a time.

When I start fpc from the command line, why am I getting ppc386 and not ppcx64? Here are the first three lines back from typing "fpc" (without the quotes) at the command prompt, and hitting [enter].

Free Pascal Compiler version 2.6.4 [2014/02/26] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
/usr/local/bin/ppc386 [options] <inputfile> [options]

Thanks,

Mark

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Adding Units to FPC from GitHub
« Reply #4 on: March 30, 2015, 08:27:18 pm »
that's because i386 is a default target (selected by "fpc") for OSX.

passing -Px86_64 to fpc will make it select ppcx64.

Mark92630

  • New Member
  • *
  • Posts: 15
Re: Adding Units to FPC from GitHub
« Reply #5 on: March 31, 2015, 02:46:15 am »
Thanks. Next question, when I look at compiling units as described in the documentation:

http://www.freepascal.org/docs-html/user/userse11.html#x27-340003.3

it refers to .pp files. But "generics.collections" has a /src folder with a bunch of .pas files and a sub-folder /src/inc, with a couple of .inc files. I tried to feed a .pas file to fpc, but it complained that the file contained an "Illegal unit name: Generics".

Is this where I need a Version 3 compiler?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Adding Units to FPC from GitHub
« Reply #6 on: March 31, 2015, 03:45:55 am »
Is this where I need a Version 3 compiler?
Yes, this is the where you need Version 3 compiler.

 

TinyPortal © 2005-2018