Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ld: library not found for -lXYZ" means what? What are the different possibilites?

What are the different possibilities when this error can occur? What are the things one should look out for, in order to get rid of this?

What if XYZ is an static library directly added to project?

like image 913
Vaibhav Tekam Avatar asked Jul 13 '12 07:07

Vaibhav Tekam


1 Answers

It means you are trying to link to a library which is not found by the system. In your case that appears to be a simple static library. You should check the following:

  • Look for the corresponding item in red among your project files, with special attention to the Frameworks group (that's where people normally put libraries). If you find one, fix the path or just remove and re-add the library manually.
  • Repeat this in the Link Binary with Libraries entry under the Build Phases tab in the project/target settings.
  • Check the Library Search Paths entry in the Build Settings tab in project/target settings. Make sure the path to your libXYZ.a file is listed there.
like image 122
Lvsti Avatar answered Sep 20 '22 01:09

Lvsti