Xcode linker Directory not found for option

xcodexcode4

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?

Best Answer

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.