在iPhone上使用FMDB创建表不起作用

时间:2012-06-03 17:52:29

标签: iphone ios sqlite fmdb

我只是试图在我的iPhone应用程序中创建一个数据库而无法构建它。 我使用了以下教程:tutorial

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *docsPath = [paths objectAtIndex:0];
    NSString *path = [docsPath stringByAppendingPathComponent:@"database.sqlite"];
    FMDatabase *database = [FMDatabase databaseWithPath:path];
    [database open];

但是在运行应用程序时,我收到以下错误消息:

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

是因为iam使用的是64位系统吗? 只是在寻找另一个版本的FMDB,但只能在gitHub FMDB repository

上找到它

1 个答案:

答案 0 :(得分:1)

确保FMDataBase.m位于“构建阶段”部分的编译源中