Linker error


#1

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/HypnoTime.app/HypnoTime normal i386
cd "/Users/ronnie1/Documents/programming/conway iOS/HypnoTime"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -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/HypnoTime.build/Debug-iphonesimulator/HypnoTime.build/Objects-normal/i386/HypnoTime.LinkFileList -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/HypnoTime.app/HypnoTime

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.


#2

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.


#3

Thanks, eqsharp.


#4

Thank you, that helped!