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

iosxcode

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?

Best Answer

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.

Related Topic