我在 VS 使用方面完全是菜鸟,尤其是在 6.0 版本中。我想在 C++ 中创建第一个使用 sqlite 库的项目。首先,我从这里下载了 *.dll 文件。现在我想在项目中使用它的库。这是我的简单代码:
#include "stdafx.h"
#include <stdio.h>
#include <sqlite3.h>
int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}
如何添加此 *.dll 文件以使 sqlite3.h 文件可见?
更新 1
我下载了合并文件并将 *.c 和 *.h 文件添加到这样的项目中:
但我收到错误和许多警告:
--------------------Configuration: DBApp - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
DBApp.cpp
C:\DOCUMENTS AND SETTINGS\ADMINISTRATOR\MOJE DOKUMENTY\POBIERANIE\DBApp\DBApp.cpp(6) : fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory
Generating Code...
Compiling...
sqlite3.c
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(238) : warning C4005: 'SQLITE_DEFAULT_PAGE_SIZE' : macro redefinition
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(234) : see previous definition of 'SQLITE_DEFAULT_PAGE_SIZE'
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(253) : warning C4005: 'SQLITE_MAX_DEFAULT_PAGE_SIZE' : macro redefinition
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(249) : see previous definition of 'SQLITE_MAX_DEFAULT_PAGE_SIZE'
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(283) : warning C4005: 'SQLITE_MAX_TRIGGER_DEPTH' : macro redefinition
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(281) : see previous definition of 'SQLITE_MAX_TRIGGER_DEPTH'
...
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(105419) : warning C4005: 'MIN' : macro redefinition
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(45386) : see previous definition of 'MIN'
c:\documents and settings\administrator\moje dokumenty\pobieranie\sqlite-src\sqlite3.c(108807) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.
DBApp.exe - 2 error(s), 232 warning(s)