Xcode linker Directory not found for option
Asked Answered
S

6

15

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?

Sarracenia answered 3/4, 2012 at 4:49 Comment(1)
You haven't removed every reference to the directory.Schwarz
U
22

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.

Unarmed answered 18/4, 2012 at 20:17 Comment(3)
Not entirely sure why but XCode at some point added every directory it could find in my repository to my library search path that had a .so, .a, .o file in it. Nothing showed up on XCode. Had to manually edit the project file.Orgasm
The right answer (for me) was: "Check the Build settings tab and make sure that the "Library search paths" option is empty".Gannet
Library Search Paths was the problem for me also. Turned out it was because I keep my project in Dropbox and the paths are different on my computers. Making the search paths relative fixed it. (I think the path was absolute because I added a library by dragging and dropping it into Build Phases)Seraph
L
6

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.

Lightface answered 19/5, 2015 at 10:51 Comment(0)
J
3

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

Josiejosler answered 2/10, 2013 at 6:40 Comment(0)
C
1

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.

Choral answered 1/4, 2016 at 3:39 Comment(0)
C
1

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

Conservatoire answered 4/5, 2016 at 9:47 Comment(0)
P
1

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

Powerless answered 16/1, 2018 at 18:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.