Build errors after upgrading MaxOSX

41 views
Skip to first unread message

rs

unread,
Apr 7, 2025, 2:29:58 AM4/7/25
to fltk.general
Hi all,

I’m having difficulty building my project on MacOS after I upgraded my system to 15.4. I am asking about it here as it is only my FLTK project which is now failing to build, and I have exhausted other avenues I am aware of.

I build my project with CMake (version 4.0.0 installed with brew), and have installed/built FLTK (v 1.4.2) on my machine using CMake.

In particular, I am getting this error at the build stage:

`make[2]: *** No rule to make target `/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/lib/libdl.tbd', needed by xxx`

I.e. it is trying to link to a file in an old, and now non-existant, version of MacOSX.sdk (14.4 vs 15.4).

Things I have tried:

remove all build files and start from scratch
uninstall and reinstall CMake
uninstall and reinstall FLTK
uninstall and reinstall all other dependencies (Boost)
uninstall and reinstall developerTools (using xcode-select)

without luck.

I have then tried to force the system into an existing sdk by making a symlink for the non-existant MacOSX14.4.sdk to one that exists. In that case I get a bit further but still fail with error messages

`ld: warning: ignoring duplicate libraries: '/usr/local/lib/libfltk.a'
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_SCContentFilter", referenced from:
       in libfltk.a[174](Fl_cocoa.mm.o)
  "_OBJC_CLASS_$_SCScreenshotManager", referenced from:
       in libfltk.a[174](Fl_cocoa.mm.o)
  "_OBJC_CLASS_$_SCShareableContent", referenced from:
       in libfltk.a[174](Fl_cocoa.mm.o)
  "_OBJC_CLASS_$_SCStreamConfiguration", referenced from:
       in libfltk.a[174](Fl_cocoa.mm.o)
ld: symbol(s) not found for architecture arm64`

At which point I have run out of ideas.

Can anyone point me in the right direction here?

Thanks,

R.

Matthias Melcher

unread,
Apr 7, 2025, 5:03:34 AM4/7/25
to fltk.general
When upgrading Xcode or macOS, the CMake cache becomes invalid. Please try rebuilding from scratch by deleting the `CMakeCache.txt`. Please let me know if that fixes it for you.

I use Xcode 16.3 and macOS 15.3.2 without issues. I don't have 15.4 yet, but I will verify this ASAP.

Matthias Melcher

unread,
Apr 7, 2025, 9:53:25 AM4/7/25
to fltk.general
As promised, I updated macOS (15.4) which in turn updated Xcode and installed new SDKs. When a new SDK is used, the cache must always be cleared. CMake remembers tha SDK it found originally and does not recognize a change in SDK which leads to all kind of trouble.

Please let me know if that fixed it for you. Thanks.

rs

unread,
Apr 7, 2025, 7:12:56 PM4/7/25
to fltk.general
Thanks for trying, but unfortunately that hasn't helped -- it was one of the first things I tried.

R.

Greg Ercolano

unread,
Apr 7, 2025, 7:50:18 PM4/7/25
to fltkg...@googlegroups.com


On 4/6/25 11:29 PM, rs wrote:
Hi all,

I’m having difficulty building my project on MacOS after I upgraded my system to 15.4. I am asking about it here as it is only my FLTK project which is now failing to build, and I have exhausted other avenues I am aware of.

[..non-fltk related build errors..]

At which point I have run out of ideas.
Can anyone point me in the right direction here?

    I see clearing the cache as Matt suggested didn't help.

    You might not be able to get good advice here, as this really might be a messy OS upgrade issue that no one here has encountered.

    If you updated your OS and was sure to upgrade the compiler too, try renaming away the entire old mac ports directory (/opt/whatever), and install Mac Ports /from scratch/, so it sees your new OS and installs all the packages based on the new os.

    If that doesn't work, I'd suggest setting up a new disk or machine with 10.15 + xcode + ports all installed from scratch (don't upgrade a 10.14 disk to 10.15), and test that.

    That's what I usually resort to when I've run into this kind of problem before, and try to learn my lesson to never upgrade critical build machines without testing first on a separate machine or boot disk, leaving my reliable machine intact.

    I'm not sure if you build commercial software, but one has to be careful with build machines. And depending on how much income you gain from selling software, it's well worth the $$$ to either purchase completely new machines for testing new OS's (getting used equipment from ebay can keep costs down), or at least grab an external disk with a fast connection (thunderbolt or usb3) and install the new OS/compiler environment on that. Some folks here use virtual machines to make this easier, to avoid having separate boot partitions + drives. But it's my personal preference to always use native installs rather than virtual, just to more closely replicate customer installs. Many of my machines run the OS on external drives; linux + osx allows this, though I don't think windows does, so I install windows locally on internal drives.


    Some general advice when it comes to build machines and upgrades:

    I always try to avoid upgrading mission critical build machines, as problems like this can really screw up the works, esp. if customers are waiting for builds. And I never upgrade into a new major release, dragons be there. For a new major release, I install it from scratch on either a separate boot drive, or separate machine completely, and install everything from scratch so I don't screw up my working build machine.

    I'll often keep old build machines even if the new one works fine, as sometimes people with older OS's can't run builds made on newer machines, so I'll supply separate builds on the old reliable machines. I often keep old build machines frozen in state for long after I stopped using them, "just in case", then at some point repurpose them, or wipe and sell them.

rs

unread,
Apr 7, 2025, 8:59:23 PM4/7/25
to fltk.general

Ok, I understand. Fortunately I'm not building commercial software :)

Thanks for the advice.

R.

rs

unread,
Apr 8, 2025, 1:35:55 AM4/8/25
to fltk.general
FWIW I found the problem. 

There was a directory /usr/local/FLTK.framework which was hanging around from an earlier install of FLTK (which I thought I had uninstalled) which pointed at 14.4.sdk.

I deleted this directory and then CMake found the right paths.

R.

Albrecht Schlosser

unread,
Apr 8, 2025, 7:58:17 AM4/8/25
to fltkg...@googlegroups.com
On 4/7/25 11:03 'Matthias Melcher' via fltk.general wrote:
When upgrading Xcode or macOS, the CMake cache becomes invalid. Please try rebuilding from scratch by deleting the `CMakeCache.txt`.

When I encounter this issue (after macOS and/or Xcode upgrades) I don't delete the entire cache because I want to keep all my build settings.

FYI: What I do is:
 - use cmake-gui
 - check the "Advanced" button
 - enter "SDK" in the "Search" field
 - mark all results (e.g. click on the top-most result, then hold the shift key and click on the last result)
 - click on "Remove Entry"

Then click on "Configure" to re-configure with the new SDK which is found automatically. This always worked for me, and I wanted to share it. YMMV.

Unfortunately I read and I'm aware that this didn't help the OP, and I have no idea how to help "@rs". I also don't have 15.4 installed yet (I'm on 15.3.1 but 15.4 is available to be installed).

Reply all
Reply to author
Forward
0 new messages