我最近正在学SQLite.
我编了一个程序(C语言):
#include <stdio.h>
#include <sqlite3.h>
int main(int argc, char* argv[])
{
sqlite3 *db;
char *zErrMsg = 0;
int rc;
rc = sqlite3_open("test.db", &db);
if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
exit(0);
}else{
fprintf(stderr, "Opened database successfully\n");
}
sqlite3_close(db);
}
可是编译时出现了这种问题:
d:/programming compile environment/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Tim_C\AppData\Local\Temp\ccEHT9Zi.o:a.c:(.text+0x26): undefined reference to `sqlite3_open'
d:/programming compile environment/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Tim_C\AppData\Local\Temp\ccEHT9Zi.o:a.c:(.text+0x3d): undefined reference to `sqlite3_errmsg'
d:/programming compile environment/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Tim_C\AppData\Local\Temp\ccEHT9Zi.o:a.c:(.text+0x94): undefined reference to `sqlite3_close'
collect2.exe: error: ld returned 1 exit status
这该怎么办呀?
谢谢😊