Trying to use Dave DeLong DDFileReader Class - objective-c

I'm trying to use Dave DeLongs DDFileReader Class but I'm getting an error while building.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_DDFileReader", referenced from:
objc-class-ref in tmnAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The "DDFileReader.m" has a set target membership and is under build phases in the "compile sources"
I'm on 10.8.3 with XCode 4.6.2
I'm sure this is a noob error but I still would appreciate the help.
Thanks

When I look in your DDFileReader.m file that you've checked into GitHub, the entire contents is:
//DDFileReader.m
#import "DDFileReader.h"
#interface NSData (DDAdditions)
#end
You need to have the entire code snippet from the .m file copied in there.

Related

what does it means these errors in obj-c?

This is the first error:
"_OBJC_CLASS_$_BNRHypnosisView", referenced from:
objc-class-ref in BNRHypnosisViewController.o
(maybe you meant: _OBJC_CLASS_$_BNRHypnosisViewController)
ld: symbol(s) not found for architecture x86_64
The second is:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What does these errors mean?
Did you add #implementation for the class?
Have you imported a .m file instead of a .h file?
Errors come both form the linker (the pice that combines compiled code into one file) and says that he can't find all he needs to do that. He misses the class BNRHypnosisView (especially for 64bit)
do you have an m file for it?
does it come from library? e.g. cocoaPods
is the library 64-bit compatible?
==> you need to add and m file or a library with the #implementation of the class.
A Header file doesn't REALLY add it. The header file only makes it known to others that the implementation will be there.... if you want, think of headers as roadsigns with townies and implementations as towns

Mach-O Linker Error in Xcode

Ok so I have 2 projects. I want to import a class file from Project 1 to Project 2. When I import the class file. I get a linker error. Here's what it looks like.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ClassFile1", referenced from:
objc-class-ref in ClassFile2.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I fix this?
Your tags include both ios and osx. if you're building an iOS app, check your Architecture setting in your Xcode project. It shouldn't be x86_64.
Possibly, you might have forget adding target to that file. In Xcode, Select the .m file and In the 'File inspector' on the right pane check Target Membership. Ensure that the target is checked for this file.

"_OBJC_CLASS_$_", referenced from: error in xcode 4.3.2

So today I ran into a major problem. I got a problem involving my viewcontroller on xcode 4.3.2 as seen in the attached code:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SecondViewController", referenced from:
objc-class-ref in Birdflix_ProViewController.o
"_OBJC_CLASS_$_ThirdViewController", referenced from:
objc-class-ref in Birdflix_ProViewController.o
"_OBJC_CLASS_$_FourthViewController", referenced from:
objc-class-ref in Birdflix_ProViewController.o
"_OBJC_CLASS_$_Author", referenced from:
objc-class-ref in Birdflix_ProViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I noticed that these errors only appear when I program IBActions linking my viewcontroller to additional classes. If I delete the IBActions the errors disappear. Any help is appreciated.
Thanks
Please add your SecondViewController.m or SecondViewController.mm, ThirdViewController.m/.mm, FourthViewController.m/.mm, Birdflix_ProViewController.m/.mm files to the Compile sources to build successfully.
To add files to compile source do the following
Build phase in xcode
Select Compile Sources
Press + button to add .m/.mm file
I think that you have added some other static library. And you have not linked it in your project target. Fist clean all targets and build again then check project setting bar shows simulator version properly for active build target.
Hope it will help.

Error message shows up when adding a class

I have a class called PrimeNumber that I wrote recently, which worked absolutely fine with a Foundation Tool and a Mac application. However, trying to use it with an iPhone application fails. I added the .m and the .h files to my project and imported the .h file to my ViewController.h like this:
#import "PrimeNumber.h"
After trying to use a method declared in my PrimeNumber class and run my application, Xcode showed me two errors:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_PrimeNumber", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The PrimeNumber.h and PrimeNumber.m files are not red in the Project navigator. Product > Clean doesn't work either. Also, because my classes aren't declared in a framework, I do not think something like that can be the problem.
Can anyone tell me what I'm doing wrong? Thanks!
Edit: changing the class name to PrimeNumbers, then creating a new Objective-C class called PrimeNumber and copy-and-pasting the complete contents of .h and .m files of the PrimeNumbers class into the .h and .m files of the PrimeNumber class worked for me. Weird, but it worked. :)
You have to add it to the "Compile Sources" Build Phase as well.
Project -> Targets -> [Your Target] -> Build Phases -> Compile Sources (just drag PrimeNumber.m in there)

Strange error when running my project

When trying to run my project I get this error and I donĀ“t know what it means :
_OBJC_CLASS_$_MyWindowController", referenced from:
objc-class-ref in AppDelegate.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What does it mean and how can I get rid of it?
Any ideas?
Select the application target, go to the Build Phases tab and make sure MyWindowController.m is in Compile Sources, otherwise add it.
Also, if you use a xib file associated with it, make sure it is in Copy Bundle Resources.
Check to see if the framework that your MyWindowController object is based on has been added to your project.
Good luck!