我正在关注此tutorial以开始在Visual C ++应用程序中使用SQLite。
但我已经创建了一个Windows窗体应用程序。
我在main
函数中添加了此代码:
sqlite3 *dbb;
char *zErrMsg;
int rc;
rc = sqlite3_open("test.db", &dbb);
我收到以下错误:
Error 2 error LNK2031: unable to generate p/invoke for "extern "C" int __clrcall sqlite3_open(char const *,struct sqlite3 * *)" (?sqlite3_open@@$$J0YMHPBDPAPAUsqlite3@@@Z); calling convention missing in metadata D:\Info\visual studio\bProject\bProject\bProject.obj
Warning 3 warning LNK4248: unresolved typeref token (01000027) for 'sqlite3'; image may not run D:\Info\visual studio\bProject\bProject\bProject.obj
Error 4 error LNK2028: unresolved token (0A00001B) "extern "C" int __clrcall sqlite3_open(char const *,struct sqlite3 * *)" (?sqlite3_open@@$$J0YMHPBDPAPAUsqlite3@@@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z) D:\Info\visual studio\bProject\bProject\bProject.obj
Error 5 error LNK2019: unresolved external symbol "extern "C" int __clrcall sqlite3_open(char const *,struct sqlite3 * *)" (?sqlite3_open@@$$J0YMHPBDPAPAUsqlite3@@@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z) D:\Info\visual studio\bProject\bProject\bProject.obj
Error 6 error LNK1120: 2 unresolved externals D:\Info\visual studio\bProject\Debug\bProject.exe
我搜索了大约几个小时,看看它意味着什么以及如何解决它们,但我发现只有图书馆可能没有正确链接...
有什么想法吗?