Question

I am attempting to build a very basic iPad app that connects to a hosted instance of MongoDB at mongohq.com. After some research, it seems that the ObjCMongoDB library will suit my needs nicely. However, after following the install instructions/commentary here and here I am unable to build. The compiler is complaining with the following errors:

Undefined symbols for architecture i386:
_OBJC_CLASS_$_NSAttributeDescription", referenced from:
  objc-class-ref in NSManagedObject+BSONCoding.o

_OBJC_CLASS_$_NSEntityDescription", referenced from:
  objc-class-ref in NSManagedObject+BSONCoding.o

_OBJC_CLASS_$_NSFetchedPropertyDescription", referenced from:
  objc-class-ref in NSManagedObject+BSONCoding.o

_OBJC_CLASS_$_NSManagedObject", referenced from:
  objc-class-ref in NSManagedObject+BSONCoding.o

_OBJC_$_CATEGORY_NSManagedObject_$_BSONCoding in NSManagedObject+BSONCoding.o

_OBJC_CLASS_$_NSRelationshipDescription", referenced from:
  objc-class-ref in NSManagedObject+BSONCoding.o

ld: symbol(s) not found for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

As a novice iOS developer, I suspect either a) I have installed it incorrectly or b) I am mistaken in my basic understanding of the library. For reference, I have checked out v0.9.7, run git submodule update --init and git submodule sync from the command line in the repo's folder. Thanks in advance for any and all guidance.

UPDATE

It appears that the .o file extensions are indicative of the compiler trying to build a Mac app, not an iPad app. Perhaps there is a setting or flag I am missing in the library to build for iOS?

Was it helpful?

Solution

It looks like you need to link against Core Data. Try adding CoreData.framework to your target's Link Binary with Libraries section.

Or, if you don't need Core Data serialization, just remove NSManagedObject+BSONCoding.[hm] from your target and/or project. The rest of ObjCMongoDB will work just fine without it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top