Skip to content
Search

IOS:Troubleshooting:CompileError

lastmod 2014-03-20created 2014-03-202 edits

This page summarizes compile error problems that occur during iOS development and how to fix them.

Apple Mach-O Linker Error

A linker-related compile error that prints a message like the following.

ld: warning: directory not found for option '-L"/Users/cwlee/Workspace/zekitalk/trunk/ios/zekitalk/third_parties/ShareKit2/Submodules/evernote-ios-sdk/UnitTests/3rdParty/OCMock"'
ld: warning: directory not found for option '-L"/Users/cwlee/Workspace/zekitalk/trunk/ios/zekitalk/third_parties/Admob"'
ld: library not found for -lGoogleAdMobAds
clang: error: linker command failed with exit code 1 (use -v to see invocation)

In this case, check the Xcode Project Setting file (PROJECT_NAME.xcodeproj/project.pbxproj) to see whether it is written in the following form.

LIBRARY_SEARCH_PATHS = (
    "$(inherited)",
    "\"$(SRCROOT)/third_parties/Admob\"",
);

If the path is not correct, fix it. In my experience, it has been entered in the following form.

"\\\"$(SRCROOT)/third_parties/Admob\\\"", /* Error!!! */