Apple Mach-O Linker Warning Directory not found

后端 未结 4 1522
耶瑟儿~
耶瑟儿~ 2021-01-30 06:39

I have spent my last five hours looking for this weird situation a reasonable explanation.

Here is the warning:

ld: warning: directory not found for opt         


        
相关标签:
4条回答
  • 2021-01-30 07:04

    You have to follow these step:

    • Click on your project (targets)
    • Click on Build Settings
    • Under "Library Search Paths", delete the paths
    • Clean your build and run again.

    Good Luck !!

    0 讨论(0)
  • 2021-01-30 07:11

    For me, the bad path was under Framework Search Paths.

    The easiest way to find where the bad path is, is to type a part of it in the search box on the top right. That will filter the list to only that one bad path. Deleting it, as the other answer suggests, fixes the problem.

    See this answer for more info.

    0 讨论(0)
  • 2021-01-30 07:19

    Also check Build Settings->Framework Search Path for unused folders (this kind of warning happened to me when I deleted Carthage from the project today)

    0 讨论(0)
  • 2021-01-30 07:29

    Had the same problem today with different solution (might help someone).

    If your source directory name $(SRCROOT) include spaces, use "$(SRCROOT)" instead of $(SRCROOT) in Library Search Paths.

    Let's say your directory name is "A B C". If you use $(SRCROOT) you might get something like:

    directory not found for option '-LA'
    directory not found for option '-LB'
    directory not found for option '-LC'
    
    0 讨论(0)
提交回复
热议问题