[fpc-devel] Issue with Compiling FPC and MacOS Big Sur

Joubert Nel joubert at joubster.com
Thu Dec 24 17:52:15 CET 2020


I've run into the same issue, but under different circumstances.
In some sense, my scenario is simpler: I'm not compiling FPC, just
compiling my own project.
Able to work around it for my particular case and thought I'd share in case
it helps others.

SCENARIO
When I have an "fpc.cfg" file in the directory in which I compile my
project, I get:

ld: library not found for -lc
An error occurred while linking
lox.pas(33,17) Error: Error while linking
lox.pas(33,17) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode

When I delete "fpc.cfg" the problem goes away.

ATTEMPTED SOLUTION: reinstall xcode command line tools & fpc compiler
1. remove xcode command line tools
      sudo rm -rf /Library/Developer/CommandLineTools/

2. reinstall xcode command line tools
      sudo xcode-select --install
      sudo xcodebuild -license accept

3. reinstall latest FPC for macOS from
https://www.freepascal.org/down/i386/macosx.html

However, the problem persists.

SOLUTION: not ideal, fine for me
When I delete the "fpc.cfg" file in my compilation directory, the problem
goes away.
The same error occurs if I have an ".fpc.cfg" file in my home directory so
I avoid that too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20201224/2f0e5fc4/attachment.htm>


More information about the fpc-devel mailing list