Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

directory not found Apple Mach-O linker warning but Library Search Path and Framework Search Path are empty

Tags:

xcode

ios

I'm getting these messages:

ld: warning: directory not found for option '-F"/Users/joel/Development/GHaikuTabbed"'
ld: warning: directory not found for option '-F"/Users/joel/Development/GHaikuTabbed/../../../Downloads"'

But when I go to Build Settings (as suggested at ‘ld: warning: directory not found for option’), Library Search Path and Framework Search Path are empty, so there's nothing to delete.

Thoughts on other things I can do to get rid of this warning?

like image 385
Joel Derfner Avatar asked Sep 27 '13 23:09

Joel Derfner


3 Answers

Here is a description how to avoid a problem based on Apple Dev Forum posted before. It works for me so I repost description for those people who don't want to go and register at the forum.

The bug is due to an error in XCode 5 when it deals with the user adding new files or folders to the project.

Xcode is modifying the 'Library Search Paths' build setting, and making a god-awful mess of it. Instead of adding $(SRCROOT)/ it is adding fully rooted paths to all new items, and adding random amounts of /// into other elements of the string. It also seems to be duplicating source paths in some instances, probably because it's broken the existing ones, and thinks they need adding again.

The solution:

  1. Copy out your Library Search Paths string into a text editor.
  2. Remove any fully rooted paths that shouldn't be there, and replace them with the usual $(SRCROOT)/MyFiles/ type paths.
  3. Remove all extraneous slashes and make sure each path has a " character at beginning and end to protect against spaces in filenames.
  4. Paste the edited string back into Build Settings.
  5. Clean, then Build. Should be back to normal.

This error may well recur if you add new files to your project, so beware.

like image 93
user2963906 Avatar answered Nov 19 '22 20:11

user2963906


My project.pbxproj looked like this:

LIBRARY_SEARCH_PATHS = (
        "$(inherited)",
        "\\\"$(SRCROOT)/AdMob-v6.4.1\\\"",
        "/MyProject/AdMob-v6.5.1",
); 

I closed MyProject, deleted the line containing AdMob-v6.4.1, reopened the project, performed a "validate project settings", cleaned, and built, and now all is well.

like image 5
QED Avatar answered Nov 19 '22 21:11

QED


Yeah, Xcode is jenky sometimes.

Did you try cleaning your build (Product > Clean Build Folder / Shift-Cmd-K) and trying again?

Another thing you can do is to search for the two entries in [project_name].xcodeproj/project.pbxproj, remove them, close XCode, re-open, Clean Build Folder and try again.

Good luck!

like image 4
Wood Guardian Avatar answered Nov 19 '22 20:11

Wood Guardian