michael03m
michael03m

Reputation: 161

Apple Mach-O-Linker (ID) Error

I added an existing class called RootViewController to my project I am working on now. The project compiled the first time, but the second time I tried to run it the mach-o-linker error popped up. I didn't change any code for that to happen, so I don't really know what's wrong. I know this error is usually because of a missing framework, but I'm pretty sure I included all the frameworks I need.

Here is the log:

Ld /Users/myusername/Library/Developer/Xcode/DerivedData/coredataproject-dhlbawbtzwdgohaczdnalonzhnhs/Build/Products/Debug-iphonesimulator/coredataproject.app/coredataproject normal i386
cd /Users/myusername/Desktop/coredataproject
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/myusername/Library/Developer/Xcode/DerivedData/coredataproject-dhlbawbtzwdgohaczdnalonzhnhs/Build/Products/Debug-iphonesimulator -F/Users/myusername/Library/Developer/Xcode/DerivedData/coredataproject-dhlbawbtzwdgohaczdnalonzhnhs/Build/Products/Debug-iphonesimulator -filelist /Users/myusername/Library/Developer/Xcode/DerivedData/coredataproject-dhlbawbtzwdgohaczdnalonzhnhs/Build/Intermediates/coredataproject.build/Debug-iphonesimulator/coredataproject.build/Objects-normal/i386/coredataproject.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -framework CoreLocation -framework MapKit -o /Users/myusername/Library/Developer/Xcode/DerivedData/coredataproject-dhlbawbtzwdgohaczdnalonzhnhs/Build/Products/Debug-iphonesimulator/coredataproject.app/coredataproject

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_RootViewController", referenced from:
      objc-class-ref in FirstViewController.o
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have searched around for hours try to find a missing link or reference, but I don't see anything wrong. Any help would be greatly appreciated.

Upvotes: 0

Views: 2866

Answers (1)

michael03m
michael03m

Reputation: 161

I just fixed it. I copied the code out of RootViewController, deleted the .h and .m files entirely, created new files and changed the name to RootViewController and pasted the code back in. It then compiled.

Upvotes: 1

Related Questions