Search code examples
objective-cioslinkerlinker-errorshpple

Hpple Error - "_OBJC_CLASS_$_TFHpple"


My app uses Hpple. I've included, TFHpple.h, TFHpple.m, TFHppleElement.h, TFHppleElement.m, XPathQuery.h & XPathQuery.m. Also included ${SDKROOT}/usr/include/libxml2 and -lxml2.

I have this tiny bit of code:

NSData *data = [[NSData alloc] initWithContentsOfFile:@"example.html"];
TFHpple *xpathParser = [[TFHpple alloc] initWithHTMLData:data];


When I try to run it, I receive this error:

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

I don't know how to solve this. Any ideas?


Solution

  • What exactly do you mean by "I've included" those files? The error indicates that you didn't add TFHpple.m to your target's "Compile Sources" build phase.