Forum > macOS / Mac OS X

SOLVED Failed to build Lazarus on Monterey x86_64: ld cannot find CoreFoundation

<< < (2/2)

trev:
You are following a red herring if you think that the dynamic linker cache is the root of your issues. You most definitely do not need to extract any files from the cache to get a working installation.

I re-build the dev version of Lazarus daily in Monterey on both Intel and M1 Mac minis upgraded from previous macOS versions and have never encountered your issue.

My advice would be to erase the current Lazarus + FPC installation and start again from scratch.

Instructions for deleting a Lazarus + FPC installation can be found on the Wiki as well as Instructions for installing Lazarus + FPC.

Jonas Maebe:
https://stackoverflow.com/questions/70031053/golang-cant-start-debug-shows-framework-not-found-corefoundation suggests that first deleting the old CommandLineTools folder may help. You could also just rename or move it if you want to be able to restore it in case it doesn't help.

PierceNg:
Thank you both for your inputs. I figured it out. Only the how, not the why.

I had to add "-Ff" option to FPC. Before, the command was this:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---fpc -Fu../../src -Fl. servcli.lpr
Now it works with this:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---fpc -Fu../../src -Fl. \  -Ff/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks \  servcli.lpr
Same for Lazarus: I set env-var OPT="-Ff<as above>" then "make ..." completed. The resulting Lazarus and lazbuild could build my LCL program after I added the same "-Ff..." to the project options, and the resulting program works.

Edit: And within Lazarus I then configured "Build Lazarus" with the same "-Ff" option. With this Lazarus rebuilt itself  successfully.

Jonas Maebe:

--- Quote from: PierceNg on March 03, 2023, 05:02:57 pm ---Now it works with this:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---fpc -Fu../../src -Fl. \  -Ff/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks \  servcli.lpr
--- End quote ---
Do not use that parameter for system frameworks. The correct parameter is "-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk", but that parameter should already be in your /etc/fpc.cfg. If it's not, reinstalling FPC (not Lazarus or FPC sources, that won't change anything) should add it.

Navigation

[0] Message Index

[*] Previous page

Go to full version