我在VS使用中总是noob,特别是在6.0版本中。我想在C ++中创建第一个使用sqlite库的项目。首先,我从here下载了* .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
我下载了amalgamation文件并将* .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)
答案 0 :(得分:1)
您必须为VisualC6项目添加一些路径(DBApp.dsp)
像这样包含Java 7包含(这是一个例子,你不需要Java):
这些库,又是Java VM的一个例子(jvm.lib / dll)
要显示此对话框,请按Alt-F7