Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is not by me
- http://dcravey.wordpress.com/2011/03/21/using-sqlite-in-a-visual-c-application/
- "As promised, here is the Native Visual C++ followup to my previous blog post. I hope you find this helpful!
- 1.Create a new C++ Win32 Console application.
- 2.Download the native SQLite DLL from: http://sqlite.org/sqlite-dll-win32-x86-3070400.zip
- 3.Unzip the DLL and DEF files and place the contents in your project’s source folder (an easy way to find this is to right click on the tab and click the “Open Containing Folder” menu item.
- 4.Open a “Visual Studio Command Prompt (2010)” and navigate to your source folder.
- 5.Create an import library using the following command line: LIB /DEF:sqlite3.def
- 6.Add the library (i.e. sqlite3.lib) to your Project Properties -> Configuration Properties -> Linker -> Additional Dependencies.
- 7.Download http://sqlite.org/sqlite-amalgamation-3070400.zip
- 8.Unzip the sqlite3.h header file and place into your source directory.
- 9.Include the the sqlite3.h header file in your source code.
- 10.You will need to include the sqlite3.dll in the same directory as your program (or in a System Folder).
- 11.Alternatively you can add the sqlite3.c file in your project, and the SQLite database engine will be included in your exe. After you add sqlite3.c to your project (right click the project and choose to add an existing file), you will need to right click on the sqlite3.c file in the Solution Explorer and change: Properties->Configuration Properties->C/C++->Precompiled Headers->Precompiled Header = Not Using Precompiled Headers"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement