简体   繁体   中英

how to add sqlite3.h, sqlite3.dll files in VS2017 in c++ in project directory

how to add sqlite3.h, sqlite3.dll files in VS2017 in c++ in project directory

E1696 cannot open source file "sqlite3.h"

You could follow the steps below to add.h and dll.

  1. Add.h: Properties -> C/C++ -> General -> Additional Include Directories

  2. Add dll: select Properties->Build Events->Post-Build Event->Command Line and input copy $(TargetPath) $(TargetDir)..\..\someFolder\myoutput.dll regasm $(TargetPath)

If you have the lib, you could refer to the steps below:

Add lib: Properties->Linker->General->Additional Library Directories

    `Properties->Linker->Input->Additional Dependencies`

If you don't have the lib, you could link explicitly to a DLL.

  • Call LoadLibraryEx or a similar function to load the DLL and obtain a module handle.
  • Call GetProcAddress to obtain a function pointer to each exported function that the application calls. Because applications call the DLL functions through a pointer, the compiler doesn't generate external references, so there's no need to link with an import library. However, you must have a typedef or using statement that defines the call signature of the exported functions that you call.
  • Call FreeLibrary when done with the DLL.

Also, you could refer to this link for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM