How do I debug framework not found with UBT?

*Showing Recent Messages
ld: framework not found XXXXX
clang: error: linker command failed with exit code 1 (use -v to see invocation)

And yes I added the framework in question to PublicAdditionalFrameworks in the Build.cs file plugin being compiled

ld helpfully suggests to run it again with -v, and I’d like to do that as well, but UBT seems to be 100% undocumented and I cannot find how that can be done anywhere on the internet.

I decided to try to run ubt from the command line with the same command line printed on the build log in Xcode (but adding a -verbose at the end in the hope ubt might decided to pass -v to ld in that case). But that doesn’t work either.

Fun times.

2 Likes

Seems to be a bug in MacToolChain.cs. I copied the relevant code from IOSToolChain.cs into MacToolChain.cs to set up the framework search path for the linker to resolve the original problem. As far as how to run ld with -v, there is no way to cause UBT to do that (probably because it triggers relinking 1000s of modules and that makes mr ubt look bad). I had to modify the UBT source code to add the flag.

Hey can you go into more detail with relevant code from the iOS tool chain to mac tool chain?

I’m trying to add a .xcframework to my plugin for Mac support and I too keep getting framework not found. This is in 5.2.

Do I need to use a custom branch of the engine to make this work? Did it get fixed? Do I need to use a .framework instead?