2015-07-12 70 views
0

我使用Xcode 7和iOS 9來創建一個簡單的應用程序,它保存數據並使用sqllite3檢索它。不過,使用libsqlite3.dylib庫和從github檢索的FMDB構建應用程序時,我收到以下錯誤消息。未定義的符號體系結構i386使用libsqlite3.dylib與FMDB Xcode 7 ios9

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: 

我在四處搜尋後發現自己很瘋狂,但找不到任何解決方案。請建議。提前致謝。

回答

0

它看起來不像你的項目鏈接到libsqlite3。仔細檢查它是否與它鏈接,如果是,可以將它添加爲鏈接器標誌。

+0

感謝您的答覆,但我怎麼添加的項目作爲鏈接器標誌?我是新來的iOS開發尚不確定 – rulebreaker4

2

檢查時是否libsqlite3.dylib在鏈接二進制與庫部分添加在構建階段

enter image description here

+0

謝謝你的回答!我在構建階段有相同的設置。即使我嘗試添加兩個sqlite3文件。仍然有同樣的問題,雖然 – rulebreaker4

+0

我加了libsqlite3.tbd,它對我來說工作得很好 –

+0

@ RegisSt-Gelais我在Xcode 7中遇到了同樣的問題,除了我已經在列表中添加了'libsqlite3.tbd'。 – Dai

相關問題