Recent

Author Topic: Error: (9021) Resource compiler "fpcres" not found  (Read 1476 times)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1589
  • Former Delphi 1-7, 10.2 user
Error: (9021) Resource compiler "fpcres" not found
« 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.
Lazarus 2.3 2021-08-10 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.3 r65500 FPC 3.3.1 r49634 macOS 11.6 aarch64 Xcode 13
Lazarus 2.3 2021-08-11 FPC 3.2.2 FreeBSD 13.0 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

dbannon

  • Hero Member
  • *****
  • Posts: 1542
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Error: (9021) Resource compiler "fpcres" not found
« Reply #1 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
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1589
  • Former Delphi 1-7, 10.2 user
Re: Error: (9021) Resource compiler "fpcres" not found
« Reply #2 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...
Lazarus 2.3 2021-08-10 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.3 r65500 FPC 3.3.1 r49634 macOS 11.6 aarch64 Xcode 13
Lazarus 2.3 2021-08-11 FPC 3.2.2 FreeBSD 13.0 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

 

TinyPortal © 2005-2018