"Linking Executable: framework not found" in 64 bit build (Sparkle framework)

I’m trying to get my 32 bit Mac app to build for 64 bit. Using Xojo 2018r1.

I am using Sparkle.framework, accessing it thru “soft” declares. In the build automation steps, I’ve added a script to copy the framework after the Build phase.

When building for 32 bit, this works fine, but for 64 bit I get this error msg:

[quote]Linking Executable
ld: framework not found @executable_path/…/Frameworks/Sparkle.framework[/quote]

Of course, at time of Build, the file is not there, yet - I can only add it afterwards. The linker should not require this file at that time, especially since I use soft declares.

Is this a known issue? How do I solve this?

Declares on OS X are always soft and “soft” is unnecessary.

Well, thanks. That doesn’t explain why this doesn’t work, though.

And the fact that the linker (and not the loader at launch of the app!) complains about the missing framework proves the opposite - that it’s a hard declare even though I use “soft”.

Also: My issue is apparently already known: <https://xojo.com/issue/49664>

This sucks. Without this resolved I cannot release many of my current Xojo apps for 64 bit (Find Any File, Prefs Editor, iClip, APFS Explorer) because they all rely on Sparkle or even additional dylibs that I cannot do without.

Huh - the issue seems to be only with included frameworks, or maybe even only with Sparkle, but not with regular custom dylibs that I include in my apps. I wish someone would look into this so that we can find out why this happens.

Oh, this is fun: I was going to mark this bug as one of my Top Cases in Feedback.app, when I noticed that the #1 bug I had marked there is this one:

<https://xojo.com/issue/46618> (App crashes on launch due to missing framework even though it’s not accessed)

And here’s the related forum post: "soft declare" leading to crash when framework is missing - macOS - Xojo Programming Forum

Seems these two are related. However, that bug is apparently also occuring with 32 bit builds, and the issue occurs at launch time, not at link time. And again, it proves that Jason Parsley’s comment above can’t be right, as it shows that “soft” is ignored, and the lib is hard-linked even though it’s not called into.

Anyway - the interesting part is the work-around proposed in there.

I just tried it, i.e. I changed the lib name for the Sparkle.framework to “Foundation” and then loaded the framework using the given “loadframework” function before calling any of the Sparkle method selectors.

So, it seems that this is not a 64 bit specific issue but rather an issue in all Xojo versions, and occurs whenever trying to access method selectors in a private framework. The issue does not occur with invoking regular functions (without the “selector” keyword in the declare statement).

Pain gained, case closed.