<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">I've run into the same issue, but under different circumstances. </div><div>In some sense, my scenario is simpler: I'm not compiling FPC, just compiling my own project. </div><div dir="ltr">Able to work around it for my particular case and thought I'd share in case it helps others.  <div><br></div><div>SCENARIO</div><div>When I have an "fpc.cfg" file in the directory in which I compile my project, I get: </div><div><br></div><div><div>ld: library not found for -lc</div><div>An error occurred while linking </div><div>lox.pas(33,17) Error: Error while linking</div><div>lox.pas(33,17) Fatal: There were 1 errors compiling module, stopping</div><div>Fatal: Compilation aborted</div><div>Error: /usr/local/bin/ppcx64 returned an error exitcode</div></div><div><div><br></div><div>When I delete "fpc.cfg" the problem goes away. </div></div><div><br></div><div>ATTEMPTED SOLUTION: reinstall xcode command line tools & fpc compiler</div><div>1. remove xcode command line tools</div><div>      sudo rm -rf /Library/Developer/CommandLineTools/</div><div><br></div><div>2. reinstall xcode command line tools </div><div><div>      sudo xcode-select --install</div><div>      sudo xcodebuild -license accept</div></div><div><br></div><div>3. reinstall latest FPC for macOS from <a href="https://www.freepascal.org/down/i386/macosx.html">https://www.freepascal.org/down/i386/macosx.html</a></div><div><br></div><div>However, the problem persists.</div><div><br></div><div>SOLUTION: not ideal, fine for me </div><div>When I delete the "fpc.cfg" file in my compilation directory, the problem goes away. </div><div>The same error occurs if I have an ".fpc.cfg" file in my home directory so I avoid that too. </div><div><br></div><div><br></div></div></div></div></div></div>