Lazarus

Using the Lazarus IDE => General => Topic started by: trev on August 02, 2021, 04:12:52 am

Title: Error: (9021) Resource compiler "fpcres" not found
Post by: trev on August 02, 2021, 04:12:52 am
After compiling a new trunk version of Lazarus, I received this error which was a little puzzling because fpcres was located in /usr/local/bin.

The -va log shows:

Code: Text  [Select][+][-]
  1. [7.840] Searching file project1.res... found
  2. [7.840] Searching file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/fpcres... not found
  3. [7.840] Searching file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/FPCRES... not found
  4. [7.840] Searching file /usr/local/lib/fpc/3.3.1/fpcres... not found
  5. [7.840] Searching file /usr/local/lib/fpc/3.3.1/FPCRES... not found
  6. [7.840] Searching file /usr/bin/fpcres... not found
  7. [7.840] Searching file /usr/bin/FPCRES... not found
  8. [7.840] Searching file /bin/fpcres... not found
  9. [7.840] Searching file /bin/FPCRES... not found
  10. [7.840] Searching file /usr/sbin/fpcres... not found
  11. [7.840] Searching file /usr/sbin/FPCRES... not found
  12. [7.840] Searching file /sbin/fpcres... not found
  13. [7.840] Searching file /sbin/FPCRES... not found
  14. [7.840] Error: (9021) Resource compiler "fpcres" not found, switching to external mode

The question is why it didn't look in /usr/local/bin which is in my path:

Code: Bash  [Select][+][-]
  1. $ echo $PATH
  2. /Users/trev/bin:/Users/trev/svn/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin

The IDE environment variables list shows an abbreviated path:

Code: Text  [Select][+][-]
  1. Environment variables:
  2. ...
  3. PATH=/usr/bin:/bin:/usr/sbin:/sbin
  4. ...

One solution was to add -FD/usr/local/bin to my existing .fpc.cfg file.

I'm still puzzled why it suddenly became necessary though and why the IDE path is not the same as my $PATH.
Title: Re: Error: (9021) Resource compiler "fpcres" not found
Post by: dbannon on August 02, 2021, 07:40:14 am
> The question is why it didn't look in /usr/local/bin which is in my path:

Maybe (and you know how much know about MacOS !) your path is set in your bash rc file and that applies when you are running a terminal but you are starting Lazarus directly, not via bash ?

Davo
Title: Re: Error: (9021) Resource compiler "fpcres" not found
Post by: trev on August 02, 2021, 01:55:11 pm
Maybe (and you know how much know about macOS !) your path is set in your bash rc file and that applies when you are running a terminal but you are starting Lazarus directly, not via bash ?

In my case, my shell is tcsh, and the path is set in .cshrc.

However, that's not the end of it, macOS has global (ie all users inherit) paths specified in:

* /etc/paths which contains, among others, /usr/local/bin
* /etc/paths.d (directory) with individual files containing an app-specific path(s)

and of course, individual user paths are set in the login shell dot resource files (like .cshrc).

It used to work and now it doesn't without some finagling...
TinyPortal © 2005-2018