Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-04

Installing FPC 2.5.1 in Mac OS X

13 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

I am trying to install FPC 2.5.1 in Mac OS X. So I tryed this steps:

1> I have FPC 2.4.2 working fine

2>

cd fpctrunk
make clean
make all
sudo make install

3> In Lazarus set the new compiler to /usr/local/bin/fpc/2.5.1/ppc386

4> Build LCL-Cocoa (works fine)

5> Build a trivial LCL project, I get somethink like this as an error: Cannot find Resource Compiler fpcres

But it is in my path =o

So I tryed to compile with -va And I got nothing helpful ...

I removed all {$R } statements from my project and it didn't help.

Any ideas?

I'll try again something at home, but now I'm at work, so because of that I cannot copy exact error messages. Just though that maybe someone will have an idea for me to try at home...

thanks,

Felipe Monteiro de Carvalho
Jonas Maebe
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
5> Build a trivial LCL project, I get somethink like this as an error: Cannot find Resource Compiler fpcres But it is in my path =o

And does it work when you manually execute it? It's also in my path and compiling with FPC 2.5.1 on Mac OS X works fine here (I've also not seen anyone else report that problem anywhere, and many people are using FPC 2.5.1 on Mac OS X for the Objective-Pascal support).

Jonas

Felipe Monteiro de Carvalho
to Jonas Maebe
Jonas Maebe wrote
And does it work when you manually execute it?

As in just typing: fpcres ?

Yes, then it shows a help message

Felipe Monteiro de Carvalho
Vincent Snijders
to Felipe Monteiro de Carvalho

2011/4/15 Felipe Monteiro de Carvalho :

Show quoted text 5 lines
On Fri, Apr 15, 2011 at 4:11 PM, Jonas Maebe wrote: > And does it work when you manually execute it? As in just typing: fpcres ?

IIRC, with -va or -vd, ppc386 shows the fpcres command line. Can you use that?

Vincent

Felipe Monteiro de Carvalho
to Vincent Snijders

Ok, very wierd now =D

If I go to the command line and type:

user-46-113-151-158:cocoa felipe$ /usr/local/lib/fpc/2.5.1/ppc386 -MObjFPC -Scghi -O1 -gl -k-framework -kCocoa -WG -vewnhi -l -Filib/i386-darwin -Fu../../lazarus/lcl/units/i386-darwin/cocoa -Fu../../lazarus/lcl/units/i386-darwin
-Fu../../lazarus/packager/units/i386-darwin -Fu. -FUlib/i386-darwin/ -va -dLCL -dLCLcocoa cocoatest.lpr

It works fine (I just copied the options which Lazarus says it uses)

But form the IDE I get:

Options changed, recompiling clean with -B
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.5.1 [2011/04/15] for i386 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Darwin for i386
Compiling cocoatest.lpr
Compiling mainform.pas
Assembling (pipe) /Users/felipe/Programas/tests/cocoa/lib/i386-darwin/mainform.s Assembling (pipe)
/Users/felipe/Programas/tests/cocoa/lib/i386-darwin/cocoatest.s cocoatest.lpr(15,32) Error: resource compiler "fpcres" not found, switching to external mode
cocoatest.lpr(15,32) Fatal: There were 1 errors compiling module, stopping

Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho
to Felipe Monteiro de Carvalho

Hello,

Ok, I managed to fix my problem:

user-46-113-147-187:carbon felipe$ cd /usr/local/lib/fpc/2.5.1/ user-46-113-147-187:2.5.1 felipe$ which fpcres
/usr/local/bin/fpcres
user-46-113-147-187:2.5.1 felipe$ sudo ln -s /usr/local/bin/fpcres fpcres

Felipe Monteiro de Carvalho
shiruba2012
to Felipe Monteiro de Carvalho

I had the same issue when specifying a specific compiler in Lazarus. I changed the directory back to

/usr/local/bin/ppc386

and it worked fine. I almost created another SymLink (as you did), and since that obviously works as well, the issue seems to be that Lazarus looks for fpcres in the same directory as the compiler, without making that clear.

Since this makes the compiler selection option useless (unless you want to make a lot of SymLinks by hand), there should probably be a separate option for the FPCRes location, no?

Thanks,
Noah Silva

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Installing-FPC-2-5-1-in-Mac-OS-X-tp4305595p5118794.html Sent from the Free Pascal - General mailing list .
Marco van de Voort
to shiruba2012

In our previous episode, shiruba2012 said:

Show quoted text 12 lines
I had the same issue when specifying a specific compiler in Lazarus. I changed the directory back to /usr/local/bin/ppc386 and it worked fine. I almost created another SymLink (as you did), and since that obviously works as well, the issue seems to be that Lazarus looks for fpcres in the same directory as the compiler, without making that clear. Since this makes the compiler selection option useless (unless you want to make a lot of SymLinks by hand), there should probably be a separate option for the FPCRes location, no?

Well, aside from installing different compilers in different prefixes (what I usually do), yes.

I would file a bug, and see how Laz devels see it.

Vincent Snijders
to Marco van de Voort

2012/1/5 Marco van de Voort :

Show quoted text 18 lines
In our previous episode, shiruba2012 said: > I had the same issue when specifying a specific compiler in Lazarus.  I > changed the directory back to > > /usr/local/bin/ppc386 > > and it worked fine.  I almost created another SymLink (as you did), and > since that obviously works as well, the issue seems to be that Lazarus looks > for fpcres in the same directory as the compiler, without making that clear. > > Since this makes the compiler selection option useless (unless you want to > make a lot of SymLinks by hand), there should probably be a separate option > for the FPCRes location, no? Well, aside from installing different compilers in different prefixes (what I usually do), yes. I would file a bug, and see how Laz devels see it.

I'd say it is a compiler bug, because the compiler doesn't look in the right places, does it? Lazarus does do the looking for fpcres, but the compiler.

Vincent

Jonas Maebe
to Vincent Snijders
Vincent Snijders wrote
I'd say it is a compiler bug, because the compiler doesn't look in the right places, does it? Lazarus does do the looking for fpcres, but the compiler.

The compiler looks for it in the $PATH. The $PATH contains /usr/local/ bin by default on Mac OS X.

Jonas

Marco van de Voort
to Vincent Snijders: 2012/1/5 Marco van de Voort : I'd say it is a compiler bug, because the compiler doesn't…

In our previous episode, Vincent Snijders said:

Show quoted text 8 lines
> Well, aside from installing different compilers in different prefixes (what > I usually do), yes. > > I would file a bug, and see how Laz devels see it. I'd say it is a compiler bug, because the compiler doesn't look in the right places, does it? Lazarus does do the looking for fpcres, but the compiler.

Jonas said it already, the compiler is a commandline tool, and always uses the %path% for such things.

Lazarus (and GUI apps in general) have less strong awareness of working directory and PATH. (to the level that e.g. Delphi is not particularly ideal with relative unit dirs either, not even after 14 versions)

So I think it is primarily a Lazarus problem, but of course the conclusion from the analysis of the Lazarus situation by the Lazarus devs could be that FPC needs this or that extension to be able to set the location of fpcres. ( or e.g. respect -FD for it, if it doesn't already).

Mattias Gaertner
to Marco van de Voort
Show quoted text 21 lines
In our previous episode, Vincent Snijders said: > > Well, aside from installing different compilers in different prefixes (what > > I usually do), yes. > > > > I would file a bug, and see how Laz devels see it. > > I'd say it is a compiler bug, because the compiler doesn't look in the > right places, does it? Lazarus does do the looking for fpcres, but the > compiler. Jonas said it already, the compiler is a commandline tool, and always uses the %path% for such things. Lazarus (and GUI apps in general) have less strong awareness of working directory and PATH. (to the level that e.g. Delphi is not particularly ideal with relative unit dirs either, not even after 14 versions) So I think it is primarily a Lazarus problem, but of course the conclusion from the analysis of the Lazarus situation by the Lazarus devs could be that FPC needs this or that extension to be able to set the location of fpcres. ( or e.g. respect -FD for it, if it doesn't already).

fpcres is not the only tool needed by fpc.
Maybe some gui to define the environment vars for running the compiler can be implemented.

Mattias

Jonas Maebe
to Mattias Gaertner
Mattias Gaertner wrote
fpcres is not the only tool needed by fpc. Maybe some gui to define the environment vars for running the compiler can be implemented.

You can use the -FD command line option for specifying an additional directory to search for the various utilities invoked by the compiler.

Jonas