Sign in Join

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

Mailing lists / fpc-devel / 2020-12

Re: Issue with Compiling FPC and MacOS Big Sur

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Joubert Nel

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.

Reply by email

Jonas Maebe
to Joubert Nel
Joubert Nel wrote
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.

Add the following line at the start of your custom config:

#include /etc/fpc.cfg

Anything you add after that statement will override the default settings from that global configuration, but you'll still have the settings that you need from it (like the sysroot path to the SDK).

Jonas

Reply by email