Undefined symbols for architecture i386 using libsqlite3.dylib with FMDB Xcode 7 ios9

本秂侑毒 提交于 2019-12-11 14:32:18

问题


I am using Xcode 7 and iOS 9 to create a simple app which saves the data and retrieves it using sqllite3. However I am getting the following error message while Building the app using libsqlite3.dylib library and FMDB retrieved from github.

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:

I am driving myself crazy after searching around however could not find any solution. Please suggest. Thanks in advance.


回答1:


Check whether if libsqlite3.dylib is added in the Link Binary with Libraries section in Build Phases




回答2:


It doesn't look like your project is linking against libsqlite3. Double check that it's linking against it, and if it is, maybe add it as a linker flag.



来源:https://stackoverflow.com/questions/31363714/undefined-symbols-for-architecture-i386-using-libsqlite3-dylib-with-fmdb-xcode-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!