Xcode linker Directory not found for option

南笙酒味 提交于 2020-01-10 02:33:05

问题


Xcode 4 is throwing me a warning about directory not found for option '-L/Users/t2wu/Documents/blah blah'. Yes it shouldn't be found because I removed it. I remove the directory and I also removed the directory setting in both the target and the project library search path. I also remove the .a file which I was linking before from the "Link binaries with Libraries". It compiles fine, it just gives me the warning. Why is it still having the -L flag?


回答1:


Check the Build settings tab and make sure that the "Library search paths" option is empty.

At last resort, fire up Terminal and cd to the app project directory (appname.xcodeproj) and do a fgrep for the erroneous search path. I've found some of these lurking in the project.pbxproj file; ended up editing the file manually to get rid of them. (Of course you should make a copy of the file before doing so, in case you trash the project file.)

It'd also be worthwhile to do a "clean" on the project. How to Empty Caches and Clean All Targets Xcode 4.




回答2:


I had the same issue in my project, it contains multiple custom framework created by me and the project. My issue is resolved by removing 'Framework search Paths' and 'Library Search Paths' from the target which has this issue.




回答3:


In my case in targets -> build settings I removed searchpaths for which errors occured. Then removed libraries from project and added them again.




回答4:


You may need to clear the Search Paths for the Tests target as well as the main project. This had me stumped for a little while.




回答5:


I checked the library search path I went to Build settings -> Search Paths change the "Framework Search Paths" to $(inherited)...that solved my problem




回答6:


Sometimes, this error occurs if you open Project.xcodeprojinstead of Project.xcworkspace. Check your project directory and make sure to open Project.xcworkspace.



来源:https://stackoverflow.com/questions/9987292/xcode-linker-directory-not-found-for-option

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!