xcode4: Linker error: Directory not found for option

前端 未结 4 1524
难免孤独
难免孤独 2020-12-13 05:53

I\'m getting this error for my profile build (debug build was OK).

{Directory not found for option \'-L../../../Mac/Profile/lib [full path of that directory]         


        
相关标签:
4条回答
  • 2020-12-13 06:34

    There are two errors that people seem to have confused

    If it is a "directory not found for option '-L/..." That means it's a Library Error, and you might want to try:

    • Click on your project (targets)
    • Click on Build Settings
    • Under Library Search Paths, delete the paths

    If it is a "directory not found for option '-F/..." That means it's a Framework Error, and you might want to try:

    • Click on your project (targets)
    • Click on Build Settings
    • Under Framework Search Paths, delete the paths

    This might happen when you move referenced files around or change the project folder name.

    0 讨论(0)
  • 2020-12-13 06:34

    I came across this error in seemingly a completely different scenario from those answers above. Hopefully some people will do what I did and find this useful even if it is a rare occurence.

    I managed to get this error after having just added a new viewController to my project. As normal I added a tableview and constrained it then added and linked the delegate and datasource. I also created a property.

    The weird thing that I then noticed was that as soon as I finished creating the property it was immediately linked, as if I had linked it, but before I linked it. When I clicked on the xib file and checked the links it wasn't in fact linked to the table view.

    enter image description here

    (This link appeared automatically without me needing to create it myself)

    I don't know why this happened. I deleted the file and remade it with the same name but it just happened again. Giving me this error above.

    The way I solved it was to create a new file, different name, and added and created the links in a different order checking at each step that this hadn't occurred. After doing this no linked created themselves and it worked.

    TL DR: If you are getting this error and have recently added new view controller then check if deleting it works and if so they remake it being careful about any automatic links.

    0 讨论(0)
  • 2020-12-13 06:40

    It was similar as above in the Library Search Paths. I found that one of my paths was missing quotes around it...

    // Old path
    $(PROJECT_DIR)/Google Analytics
    
    // New path
    "$(PROJECT_DIR)/Google Analytics"
    
    0 讨论(0)
  • 2020-12-13 06:51

    Go to "Get Info" on the target. Click the "Build Settings" tab (i'm using Xcode4), and scroll down to "Search Paths", Where You delete all the values in "Library Search Paths".

    Hope that helps...

    0 讨论(0)
提交回复
热议问题