Forum > macOS / Mac OS X

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

(1/2) > >>

PierceNg:
I upgraded my laptop from Catalina to Monterey. Now Lazarus doesn't build.

- FPC 3.2.2 built on Catalina from source
- Lazarus branches main and fixes_2_2

For both Lazarus branches, 'make clean bigide' fails at building lazres:

--- 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";}};} ---Assembling lazresLinking ./lazresld: framework not found CoreFoundation
I restored copy of Lazarus 2.2 built from source on Catalina from archive. It runs, but it fails to build my app (which builds with this restored version of Lazarus when my laptop was running Catalina):


--- 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";}};} ---% lazbuild ...ld: framework not found Cocoa
Xcode IDE and command line tools appear to work, as a GUI C++ library and executables build successfully.

According to MacPorts, 'port health' for Lazarus on Monterey x86_64 is a cross.

Jonas Maebe:
After upgrading your OS, you need to reinstall the developer command line tools with
--- Code: ---sudo xcode-select --install
--- End code ---
.

PierceNg:

--- Quote from: Jonas Maebe on February 27, 2023, 10:47:55 pm ---After upgrading your OS, you need to reinstall the developer command line tools with
--- Code: ---sudo xcode-select --install
--- End code ---

--- End quote ---

Thanks. Didn't work:


--- 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";}};} ---% sudo xcode-select --installPassword:xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Software Update offers me upgrade to Ventura, nothing else.

Right now I can use command line developer tools to build, e.g., webview; this library wraps Cocoa WebKit on macOS. Its demos run.

Also, using FPC (built on Catalina), two of my webview Pascal FFI demos build and run, one builds and runs but doesn't function, and two others complain about not finding macOS frameworks. Every demo opens a window and runs Cocoa WebKit in it.

Curious. Looks like I gotta spend some time on this...

PierceNg:
I found these:

- https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes
- https://lapcatsoftware.com/articles/bigsur.html

Quoting Apple,
--- Quote ---New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)
--- End quote ---

PierceNg:
So I followed the links I found, built some tools they pointed to, and could extract the individual framework/library files from the system caches. Well, for ARM64 and x86_64h 'Haswell' architectures, but not for my laptop's own pre-Haswell x86_64 architecture.

I think it is due to Open Core Legacy Patcher (OCLP). My laptop is > 10yo and officially it can only run up to Catalina. Thanks to OCLP I could upgrade it to Monterey. But most likely OCLP's presence caused the extraction attempt to fail. It so happens I just updated the OS on this laptop 2 days ago, and at least that once the OS update wiped out OCLP. Without OCLP I reckon I should be able to do the extraction.

KIV until next OS update then... 

Navigation

[0] Message Index

[#] Next page

Go to full version