我刚刚开始使用sqlite,并且每当我尝试编译此代码时:
#include <iostream>
#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));
return(0);
} else {
fprintf(stderr, "Opened database successfully\n");
}
sqlite3_close(db);
}
我收到以下错误:
“ c:/ mingw / bin /../ lib / gcc / mingw32 / 6.3.0 /../../../ libmingw32.a(main.o):(。text.startup + 0xa0) :未定义对“ WinMain @ 16”的引用 collect2.exe:错误:ld返回1退出状态”