使用libsqlite3.dylib和FMDB Xcode 7 ios9的体系结构i386的未定义符号

时间:2015-07-12 02:14:25

标签: ios swift sqlite fmdb xcode7-beta2

我正在使用Xcode 7和iOS 9创建一个简单的应用程序,它使用sqllite3保存数据并检索它。但是,在使用libsqlite3.dylib库和从github检索到的FMDB构建应用程序时,我收到以下错误消息。

Undefined symbols for architecture i386:
  "_sqlite3_bind_blob", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_bind_double", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_bind_int", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_bind_int64", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_bind_null", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_bind_parameter_count", referenced from:
      -[FMDatabase executeQuery:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o
      -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o
  "_sqlite3_bind_parameter_index", referenced from:
      -[FMDatabase executeQuery:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o
      -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] in FMDatabase.o
  "_sqlite3_bind_text", referenced from:
      -[FMDatabase bindObject:toColumn:inStatement:] in FMDatabase.o
  "_sqlite3_busy_handler", referenced from:
      -[FMDatabase setMaxBusyRetryTimeInterval:] in FMDatabase.o
  "_sqlite3_changes", referenced from:
      -[FMDatabase changes] in FMDatabase.o
  "_sqlite3_close", referenced from:
      -[FMDatabase close] in FMDatabase.o
  "_sqlite3_column_blob", referenced from:
      -[FMResultSet dataForColumnIndex:] in FMResultSet.o
      -[FMResultSet dataNoCopyForColumnIndex:] in FMResultSet.o
  "_sqlite3_column_bytes", referenced from:
      -[FMResultSet dataForColumnIndex:] in FMResultSet.o
      -[FMResultSet dataNoCopyForColumnIndex:] in FMResultSet.o
  "_sqlite3_column_count", referenced from:
      -[FMResultSet columnCount] in FMResultSet.o
      -[FMResultSet columnNameToIndexMap] in FMResultSet.o
      -[FMResultSet kvcMagic:] in FMResultSet.o
      -[FMResultSet resultDictionary] in FMResultSet.o
  "_sqlite3_column_double", referenced from:

我在搜索周围后自己发疯,但无法找到任何解决方案。请建议。提前谢谢。

2 个答案:

答案 0 :(得分:2)

检查是否在Build Phases的Link Binary with Libraries部分中添加了libsqlite3.dylib

enter image description here

答案 1 :(得分:1)

看起来您的项目与libsqlite3无关。仔细检查它是否与它相关联,如果是,可以将其添加为链接器标记。