How to Fix “ld: library not found for” in macOS Xcode

When trying to run an Xcode project, you may receive the following error: “ld: library not found for -lXXX”. This means that the linker could not find a static library that your project depends on.

There are 3 ways to fix this error:

  1. Add the missing library to your project.
  2. Change the “Library Search Paths” build setting in your project to include the directory where the missing library is located.
  3. Add the path of the static library to the “LD_LIBRARY_PATH” environment variable.

In addition, you can also add the following -L/Library/Developer/CommandLineTools/usr/lib/swift_static/macosx/

Leave a Comment

Cydia Geeks