Linker error


My program for Chapter 7 was working until the Build and Run on page 136. Now I get the following error:

Ld /Users/ronnie1/Library/Developer/Xcode/DerivedData/HypnoTime-cnslkvyjyayzrnevtkcvheievfxf/Build/Products/Debug-iphonesimulator/ normal i386
cd "/Users/ronnie1/Documents/programming/conway iOS/HypnoTime"
setenv PATH “/Applications/”
/Applications/ -arch i386 -isysroot /Applications/ -L/Users/ronnie1/Library/Developer/Xcode/DerivedData/HypnoTime-cnslkvyjyayzrnevtkcvheievfxf/Build/Products/Debug-iphonesimulator -F/Users/ronnie1/Library/Developer/Xcode/DerivedData/HypnoTime-cnslkvyjyayzrnevtkcvheievfxf/Build/Products/Debug-iphonesimulator -filelist /Users/ronnie1/Library/Developer/Xcode/DerivedData/HypnoTime-cnslkvyjyayzrnevtkcvheievfxf/Build/Intermediates/ -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/ronnie1/Library/Developer/Xcode/DerivedData/HypnoTime-cnslkvyjyayzrnevtkcvheievfxf/Build/Products/Debug-iphonesimulator/

Undefined symbols for architecture i386:
"OBJC_CLASS_HypnosisView", referenced from: objc-class-ref in HypnosisViewController.o (maybe you meant: _OBJC_CLASS__HypnosisViewController)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

UIKit, Foundation, and CoreGraphics all show as Linked in Build Phases.
I’m running Xcode 4.3 on OS X 10.7.2.
Any suggestions on what my problem might be would be much appreciated. Thanks.


I ran into the exact same issue. Here is what I did to resolve it.

  1. In the Project Navigator on the left side of your screen, click on “HypnoTime” (your project) at the top.
  2. Then select “HypnoTime” under Targets and “Build Phases” in the editor area.
  3. Open the “Compile Sources” step. Most likely the “HypnosisView.m” file is missing from here.
  4. If it is missing, drag the “HypnosisView.m” file from the Project Navigator to the list of compile sources.
  5. Rebuild and errors should clear.

Hope this helps save others time who may run into this issue.


Thanks, eqsharp.


Thank you, that helped!