我是iOS的新手,在通过SQLite保存和检索数据时,我收到Apple Mach-o错误(8个错误)。我已将构建设置设置为搜索库路径但其为空。我添加了libz.dylib和libsqlite3库。
Undefined symbols for architecture i386:
"_sqlite3_close", referenced from:
-[ViewController viewDidLoad] in ViewController.o
-[ViewController saveData:] in ViewController.o
-[ViewController findData:] in ViewController.o
"_sqlite3_column_text", referenced from:
-[ViewController findData:] in ViewController.o
"_sqlite3_exec", referenced from:
-[ViewController viewDidLoad] in ViewController.o
"_sqlite3_finalize", referenced from:
-[ViewController saveData:] in ViewController.o
-[ViewController findData:] in ViewController.o
"_sqlite3_open", referenced from:
-[ViewController viewDidLoad] in ViewController.o
-[ViewController saveData:] in ViewController.o
-[ViewController findData:] in ViewController.o
"_sqlite3_prepare_v2", referenced from:
-[ViewController saveData:] in ViewController.o
-[ViewController findData:] in ViewController.o
"_sqlite3_step", referenced from:
-[ViewController saveData:] in ViewController.o
-[ViewController findData:] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
答案 0 :(得分:0)
你还没有链接到sqlite
库(如果你认为你已经错了)。