2013-08-20 70 views
0

所以我想在iOS應用程序中啓動並運行ObjCMongoDb,但我一直收到這個錯誤。如何將ObjCMongoDb集成到iOS應用程序中?

ignoring file /Users/user/Documents/Programming/ObjCMongoDB/ObjCMongoDB.framework/ObjCMongoDB, file was built for unsupported file format (0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0) which is not the architecture being linked (armv7): /Users/user/Documents/Programming/ObjCMongoDB/ObjCMongoDB.framework/ObjCMongoDB 
Undefined symbols for architecture armv7: 
    "_OBJC_CLASS_$_BSONDecoder", referenced from: 
     objc-class-ref in MongoDbConnection.o 
    "_OBJC_CLASS_$_MongoKeyedPredicate", referenced from: 
     objc-class-ref in MongoDbConnection.o 
    "_OBJC_CLASS_$_MongoUpdateRequest", referenced from: 
     objc-class-ref in MongoDbConnection.o 
    "_OBJC_CLASS_$_MongoConnection", referenced from: 
     objc-class-ref in MongoDbConnection.o 
ld: symbol(s) not found for architecture armv7 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我有一種感覺,這意味着框架不會被編譯爲iOS,但在Mac OS X

有誰知道如何ObjCMongoDb集成到iOS應用程序?

謝謝!

回答

1

要在iOS上使用框架,您需要將其構建爲一個靜態庫,其中ObjCMongoDB的一部分的Xcode項目不提供一種方法。

最簡單的方法是按照getting started on Mac OS的說明進行操作,這應該在iOS上同樣適用。

+0

我對這個文檔有點困惑。它告訴我添加六個文件bson.c,encoding.c等。它在哪裏要我添加這些文件?他們已經添加到項目中,因爲當我現在運行時,我得到100個錯誤。 – adeiji

+0

嘗試刪除框架並重新開始。 – paulmelnikow

+0

嘗試過了,仍然是同樣的問題... – adeiji

相關問題