objective c - ObjCMongoDB broken? I can't get it to work -
full disclosure:
i'm not educated programmer, , entirety of programming experience in javascript , objective-c.
so know you're dealing with. tread carefully. no sudden moves.
i'm writing ipad app talks mac server. i'd use mongodb backend, , objcmongodb looks perfect fit, can't work using instructions here:
https://github.com/noa--/objcmongodb/wiki/gettingstarted
my repro steps:
from main objcmongodb page on github, click "clone in mac" (i'm using github mac handle download)
from command line, navigate objcmongodb directory , type:
git submodule update
then:
git checkout v0.9.6
copy mongo-c-driver/src folder xcode project folder
in xcode, make new group in project called "objcmongodb" , select it
add src folder step 4 project, not target.
change name of src in project mongo-c-driver
add these files in mongo-c-driver target:
- bson.c
- encoding.c
- numbers.c
- mongo.c
- md5.c
- env.c
in xcode, select objcmongodb group again, , add both project , target following folders, checking "create groups added folders":
- objcmongodb/bson
- objcmongodb/mongo
- objcmongodb/ordereddictionary
according step-by-step guide, should able build & run project now, there errors.
first, mongoconnection+diagnostics.h:
#import <objcmongodb/objcmongodb.h>
i don't have framework called objcmongodb @ point, fail.
even more confusing this nifty error, followed api in question:
int bson_init_finished_data( bson *b, char *data, bson_bool_t ownsdata ) { _bson_zero( b ); b->data = data; b->datasize = bson_finished_data_size( data ); b->ownsdata = ownsdata; b->finished = 1; return bson_ok; }
certainly seems expect 3 arguments...
so i'm @ loss. appreciated.
i'm author of objcmongodb. interest in library , heads-up question.
to fix first problem, change #import
line in mongoconnection+diagnostics.h
#import "objcmongodb.h"
. (that's been fixed in master, subsequent last release.)
the other problem happening because v0.9.6 based on earlier version of mongo c driver files you're using, i'm guessing downloaded or cloned 10gen repository on github.
the c driver set submodule, when clone objcmongodb should see empty mongo-c-driver
folder.
from repository root, can run command:
git submodule update --init
which should load correct version of mongo c driver (my fork of v0.9.6, next release use official version). i'm adding note readme step.
once add versions of .[ch]
files project instead, should build correctly.
Comments
Post a Comment