iOS Build Environment Help Center

ld64.lld: error: library not found for -ld64

append delete hyeondo

Windows 10 pro(22H2)
Builder 3.60.2
iOS SDK 17.2
Error log: https://pmbaty.com/paste/?0238804f136152ac#R1mGoFBi8nTDmRPZ6T2f1MXQfJrC1znR7f3T6zr6g7B

Hello

The following error occurred during building. (ld64.lld: error: library not found for -ld64)
I couldn't find anything related to the error in the documentation.
I would like to ask for your help in resolving the issue.

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

This error message is new to me so thank you for reporting. I don't see where this "d64" library comes from. Do you use any special compiler or linker flags?

append delete #2. hyeondo

There are no separate compiler or linker flags.
This project works well when built with xcode on mac.
I will let you know if we need more information to help you resolve the issue.

(I will be on vacation until February 12th, so my next response may be delayed.)

append delete #3. Pierre-Marie Baty

Could you please send me this Xcode project by email (or possibly a stripped down version with the same symptoms) at pm @ this domain so that I can reproduce the problem and fix it ? Confidentiality is guaranteed. Thanks in advance.

append delete #4. Pierre-Marie Baty

FYI I understood what's wrong in your case. Either you or your project passes the "-ld64" custom option to the linker, to instruct Xcode to use the legacy Apple linker and not the LLVM one. But this option is not a valid linker option but rather an Xcode hack, it is "eaten" by Xcode and does not appear in the linker's command line.

To fix the issue, you need to remove that -ld64 option from the extra linker flags (or from the Xcode project file), and select to use the Apple linker and not the LLVM one.

append delete #5. hyundo

It seems difficult to send an xcode project due to company policy.
Sorry.

As you suggested, the error was resolved by removing the "-ld64" option, but a different error log message occurred, so we would like to share this with you.

Error log: https://pmbaty.com/paste/?d5c5146741a59041#4JCVu2iY7Tvx5ZitXNbSG7uHEHVMsHfUPPiTng7xn2qd

I found a post about the same error.(https://www.pmbaty.com/iosbuildenv/help/thread.php?path=Problem%20solving/&file=build-error-with-large-projects-when-using- llvm-relocation-branch26-is-out-of-range)
According to this article, this error occurs when using the LLVM linker, but I understand that if you remove the "-ld64" option, the Apple linker will be used. Am I doing something wrong? If you have any advice on this, please let me know.

append delete #6. hyundo
append delete #7. MLR_

Hi,

it seems I have a similar issue with CoreAudioTypes (LLVM compiler ld64.dll warning & errors : https://pmbaty.com/paste/?89e8989e4e0d744b#CzGLpjdT65Ja49u8JaKsU45a94WXz8UqD3BcYF5Stoot )

I already tried to upgrade the SDK using the migration files from iOS Buidler 3.61 (iOS 17.2 and even 17.4 from xcode-beta) but I cannot produce the IPA : with LLVM CoreAudioTypes is not found, with Apple compiler fatal error is raised telling UnityFrameWork/UnityAppController.h is not found ( https://pmbaty.com/paste/?da88030bb179486d#GjT2BeZ8ZqSujDHRntR6hEtYTCyuafPScRhZLLAf3J69 ).

Is there a "bug" while exporting the iOS project with Unity 2022.3.19f1 ?
I will try to export an "empty" project using the same Unity version and packages (I then will be able to send you the Unity project if needed).

Windows Version : 10
Unity version 2022.3.19f1
Unity iOS Builder version :3.61
iOS SDK : 17.4

append delete #8. Pierre-Marie Baty

@MLR_: for these sort of error ("framework not found for -framework CoreAudioTypes") you need to use the Apple linker, not the LLVM one, and remove the "-ld64" linker flag if your project has one. The Apple linker I supplied in v3.61 should be able to build these projects.

@hyundo: same remark, you need to do two things: 1. remove the "-ld64" flag, and 2. *uncheck* the "Use the LLVM linker" checkbox in the builder UI. You haven't done that because the build log you posted shows linker errors that only the LLVM linker (ld64.lld) generates.

append delete #9. MLR_

I tried with Apple Linker but an error is still raised : UnityFrameWork/UnityAppController.h is not found :(
https://pmbaty.com/paste/?da88030bb179486d#GjT2BeZ8ZqSujDHRntR6hEtYTCyuafPScRhZLLAf3J69

append delete #10. Pierre-Marie Baty

Looks like a missing header file. Where is the file called UnityAppController.h located in your Xcode project ?

append delete #11. MLR_

I found it there : build\Release-iphoneos\UnityFramework\headers-public\UnityFramework\

:: @MLR_ added on 13 Feb ’24 · 16:11

May it be be an ENVIRONMENT PATH issue ?

append delete #12. Pierre-Marie Baty

Nope. The contents of the "build" folder is created by the builder. The .h files created there actually link to original files that must be present elsewhere. Is that file present in another location ?

append delete #13. MLR_

I found it in the directory .\Classes\ too

append delete #14. Pierre-Marie Baty

Well then that #import directive in your Xcode project’s source code is wrong because it doesn’t point at the right location where that header file is. It should either be #import "Classes/UnityAppController.h" *or* that file should be elsewhere. It’s either situation.

Try generating it again from Unity and see if that fixes it. If not, move it to a Mac and see if Xcode can build it. If it can’t (as I suspect) then head up to the Unity support forum for help because it’ll mean your Unity project generates invalid iOS code.

Let me know how it turns out please.

append delete #15. hyundo

Hello

I fixed the error and the builder works great!
Thanks for your help!

append delete #16. Pierre-Marie Baty

Glad to hear it ! You’re welcome.

append delete #17. MLR_

I tried to generate a new iOS app from an empty project (Unity 2022.3.19f1) and still have the same issue. I will post on Unity support now.

:: @MLR_ added on 20 Feb ’24 · 11:35

FYI I tried to build a similar app generated from Unity 2021.3.17f1 (with the same version of iOS builder & same SDK) ... and it worked perfectly ! It really seems to be an issue related to the Unity version.

append delete #18. MLR_

I solved the issue editing the UnityFramework.h file (in UnityFramework directory)

#import <UnityFramework/UnityAppController.h>

was modified in

#import <UnityAppController.h>

since UnityAppController.h is in Classes directory it should not appear in the UnityFramework directory in the UnityFramework.h ! I send that issue to Unity right now ;)

append delete #19. Pierre-Marie Baty

Very interesting! This suggests that the Xcode project has an extra include path that the builder fails to pick up... or that this version of Unity indeed generates bogus Xcode projects. I'll soon find out if the first case is the right one.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty