Recent

Author Topic: Lazarus can't find FPC  (Read 32161 times)

ArriveSoft

  • New member
  • *
  • Posts: 9
Lazarus can't find FPC
« on: December 11, 2009, 05:46:32 pm »
I am trying to set up a MacBook OS X 10.6.1 with Lazarus and FPC.

First, Lazarus installed without a problem and is working... unless I try to compile.

Second, the FPC installer (fpc-2.2.4.Intel-macosx.pkg) said it installed successfully.  Also XCode.

But, Lazarus cannot find FPC.  Neither can I.

Should I re-install Lazarus?
What directory did FPC get installed to?  All I can find is the FPC documentation at Developer/Documentation/Free Pascal Compiler.


Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Lazarus can't find FPC
« Reply #1 on: December 11, 2009, 06:06:14 pm »
In Lazarus, choose Environment | Options and make sure the paths are correct. Typically you would set compiler path to:

/usr/local/bin/ppc386

FPC source directory:

/usr/local/share/fpcsrc

Make path:

/usr/bin/make

See if that helps any.

Thanks.

-Phil

lrflew

  • Newbie
  • Posts: 2
Re: Lazarus can't find FPC
« Reply #2 on: December 13, 2009, 11:07:14 pm »
I need help with this too. 

In Lazarus, choose Environment | Options and make sure the paths are correct. Typically you would set compiler path to:

/usr/local/bin/ppc386

FPC source directory:

/usr/local/share/fpcsrc

Make path:

/usr/bin/make

See if that helps any.

Thanks.

-Phil


No that didn't work. 

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Lazarus can't find FPC
« Reply #3 on: December 13, 2009, 11:11:23 pm »
I need help with this too. 

No that didn't work. 

Please provide more information.

Thanks.

-Phil

ArriveSoft

  • New member
  • *
  • Posts: 9
Re: Lazarus can't find FPC
« Reply #4 on: December 14, 2009, 10:43:35 pm »
/usr/local/bin/ppc386 worked.

But, there was no fpcsrc directory in ../share.
Instead, I only found usr/local/share/src which contains
fpc-2.2.4/demo/

Lazarus says, "Invalid Free Pascal source directory".

So, I'm one step closer, but not there yet.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Lazarus can't find FPC
« Reply #5 on: December 14, 2009, 10:51:53 pm »
You did install the fpcsrc package too, didn't you?

Thanks.

-Phil

ArriveSoft

  • New member
  • *
  • Posts: 9
Re: Lazarus can't find FPC
« Reply #6 on: December 15, 2009, 09:15:32 pm »
You did install the fpcsrc package too, didn't you?

Thanks.

-Phil


No, but I just downloaded the source files.  They are all now located in my Download directory.  How can I create the /usr/local/share/fpcsrc directory and transfer all of the files to there?

Or where is the package located that installs the source files to the
correct place?

Thank you.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Lazarus can't find FPC
« Reply #7 on: December 15, 2009, 09:32:32 pm »
Use the fpcsrc .dmg for the fpc compiler .dmg that you installed.

To use SVN source, compile from source too.

If you want to use the latest FPC trunk source (2.5.1), an easy way to get that is:

- Get install_objp.sh script from this site:

    http://www.thealchemistguild.org/objp.php

- Open install_objp.sh in TextEdit and change the first line (if needed) from
  branches/objp to trunk.
 
- Open a Terminal window and cd to where install_objp.sh is located and enter:
 
- chmod +x install_objp.sh

- sudo ./install_objp.sh

This will download FPC 2.5.1 under /Developer/ObjectivePascal.

To download and build Lazarus from latest SVN trunk:

cd ~/lazarus (or wherever you want it)
svn co http://svn.freepascal.org/svn/lazarus/trunk .
make FPC=/usr/local/lib/fpc/2.5.1/ppc386

Start Lazarus and on Environment | Options:

Compiler path:  /usr/local/lib/fpc/2.5.1/ppc386
FPC source directory:  /Developer/ObjectivePascal/fpc/
Make path:  /usr/bin/make

If you're just starting out, you might be better off just using the stable .dmg's (0.9.28.2 / FPC 2.2.4). However, if you want to start working with the new support for Cocoa classes, you'll need 2.5.1.

Thanks.

-Phil

ArriveSoft

  • New member
  • *
  • Posts: 9
Re: Lazarus can't find FPC
« Reply #8 on: December 17, 2009, 08:16:45 pm »
I successfully installed 0.9.29 and fpc and fpcsrc and Lazarus found them.

I don't know what Cocoa is, so that will be for further study.

Now, what happens is:

Unit Unit1;
{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, Menus;
type   <<< unit1.pas(13,36) Error: Assembler not found, switching to external assembling

One step closer to being able to use Pascal via Lazarus.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Lazarus can't find FPC
« Reply #9 on: December 17, 2009, 08:22:46 pm »
I successfully installed 0.9.29 and fpc and fpcsrc and Lazarus found them.

I don't know what Cocoa is, so that will be for further study.

Now, what happens is:

Unit Unit1;
{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, Menus;
type   <<< unit1.pas(13,36) Error: Assembler not found, switching to external assembling

One step closer to being able to use Pascal via Lazarus.


What exactly did you install? 0.9.28 from snapshot or SVN? FPC from snapshot (2.2.4) or SVN (2.5.1)?

Thanks.

-Phil

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Lazarus can't find FPC
« Reply #10 on: December 17, 2009, 11:23:41 pm »
type   <<< unit1.pas(13,36) Error: Assembler not found, switching to external assembling

One step closer to being able to use Pascal via Lazarus.


The above error suggests that you deselected support for UNIX development when you installed Xcode. As the readme on the official FPC installation disk images mentions, you must have installed this for FPC to work (and the official FPC versions will actually refuse to install if you didn't install support for UNIX development, but the Lazarus-packaged versions unfortunately don't include such a check in the installer).

So the solution is: relaunch the Xcode installer and this time do not deselect any of the options that are checked by default.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Lazarus can't find FPC
« Reply #11 on: December 17, 2009, 11:33:30 pm »
Should that be posted as a Lazarus bug? The Lazarus FPC installer really should at least warn about this - in this case, that's probably all that should have been necessary for him to be able to fix it.

Thanks.

-Phil

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Lazarus can't find FPC
« Reply #12 on: December 17, 2009, 11:37:04 pm »
Should that be posted as a Lazarus bug?

Probably, yes. The check that the FPC installer does is to simply look whether "/usr/bin/gcc" exists. Other possible checks are /usr/bin/as and/or /usr/bin/ld.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Lazarus can't find FPC
« Reply #13 on: December 17, 2009, 11:41:59 pm »
I don't know what Cocoa is, so that will be for further study.

Here's one link:

http://wiki.freepascal.org/FPC_PasCocoa#Objective-C_FPC_Compiler

The ability to work directly with ObjC (and Cocoa) classes in FPC is for me probably the most interesting thing to happen with FPC.

The other place to start is Apple's voluminous on-line docs on the Cocoa (NS) classes.

If you've built 2.5.1 and want to try out a simple Cocoa app that is structured in a way that should make sense to Delphi/Laz folks, download NoNib.zip from here. It includes a little readme.txt file that you might want to look at:

http://web.fastermac.net/~MacPgmr/Lazarus/

You might ask, what's the advantage of this over a Lazarus GUI app? Well, no dependency on LCL, very small executables, etc. - this is the real thing. Lazarus is still very important for cross-platform apps, but if you're doing a Mac-only app, or an iPhone app, or just doing a separate Mac UI for a cross-platform app, this is the way to do it.

Thanks.

-Phil

ArriveSoft

  • New member
  • *
  • Posts: 9
Re: Lazarus can't find FPC
« Reply #14 on: December 18, 2009, 07:17:42 pm »
type   <<< unit1.pas(13,36) Error: Assembler not found, switching to external assembling

One step closer to being able to use Pascal via Lazarus.


The above error suggests that you deselected support for UNIX development when you installed Xcode. As the readme on the official FPC installation disk images mentions, you must have installed this for FPC to work (and the official FPC versions will actually refuse to install if you didn't install support for UNIX development, but the Lazarus-packaged versions unfortunately don't include such a check in the installer).

So the solution is: relaunch the Xcode installer and this time do not deselect any of the options that are checked by default.

I reinstalled fpc-xcode-2.24.pkg.  It asked no questions about Unix this time, it just re-installed, and the problem remains.

Everything is now compiling OK with the Quick Compile, but the executable can't be created.

Thanks.

 

TinyPortal © 2005-2018