" _sqlite3_key"未找到架构i386的符号 [英] "_sqlite3_key" Symbol(s) not found for architecture i386
本文介绍了" _sqlite3_key"未找到架构i386的符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我使用此SQLCipher( http://sqlcipher.net/ios-tutorial/ )加密我的sqlite但是当我编译时遇到了这个错误
Hi I used this SQLCipher(http://sqlcipher.net/ios-tutorial/) to encrypt my sqlite but when I compile I met this error
"_sqlite3_key", referenced from:
-[LCAppDelegate application:didFinishLaunchingWithOptions:] in LCAppDelegate.o
Symbol(s) not found for architecture i386
当我在AppDelegate中使用此代码时发生了这种情况
It happened when I used this code in my AppDelegate
#import <sqlite3.h>
...
NSString *databasePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
stringByAppendingPathComponent: @"sqlcipher.db"];
sqlite3 *db;
if (sqlite3_open([databasePath UTF8String], &db) == SQLITE_OK) {
const char* key = [@"BIGSecret" UTF8String];
sqlite3_key(db, key, strlen(key));
if (sqlite3_exec(db, (const char*) "SELECT count(*) FROM sqlite_master;", NULL, NULL, NULL) == SQLITE_OK) {
// password is correct, or, database has been initialized
} else {
// incorrect password!
}
sqlite3_close(db);
}
任何人都知道如何解决这个问题?请帮助我!!!
Anyone know how to solve this? Please help me !!!
推荐答案
你没有为i386编译它 - 看教程
You didnt compile it for i386 -- looking at the tutorial
将i386添加到有效的archs&要建造的拱门。
add i386 to the valid archs & the archs to build.
=>只有SIMULATOR是i386
=> only the SIMULATOR is i386
这篇关于" _sqlite3_key"未找到架构i386的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文