Advertisement
obernardovieira

[Tutorial] Using SQLite in a Native Visual C++ Application

Apr 25th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. This is not by me
  2.  
  3. http://dcravey.wordpress.com/2011/03/21/using-sqlite-in-a-visual-c-application/
  4.  
  5.  
  6. "As promised, here is the Native Visual C++ followup to my previous blog post. I hope you find this helpful!
  7.  
  8. 1.Create a new C++ Win32 Console application.
  9. 2.Download the native SQLite DLL from: http://sqlite.org/sqlite-dll-win32-x86-3070400.zip
  10. 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.
  11. 4.Open a “Visual Studio Command Prompt (2010)” and navigate to your source folder.
  12. 5.Create an import library using the following command line: LIB /DEF:sqlite3.def
  13. 6.Add the library (i.e. sqlite3.lib) to your Project Properties -> Configuration Properties -> Linker -> Additional Dependencies.
  14. 7.Download http://sqlite.org/sqlite-amalgamation-3070400.zip
  15. 8.Unzip the sqlite3.h header file and place into your source directory.
  16. 9.Include the the sqlite3.h header file in your source code.
  17. 10.You will need to include the sqlite3.dll in the same directory as your program (or in a System Folder).
  18. 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