Visual Studio 2015 (C++) sqlite3.dll unresolved external symbol -
i cannot figure out how sqlite3.dll (or dll matter) work c++ project in visual studio.
the error message lnk2001 unresolved external symbol sqlite3_open
here's did far:
- i put .dll in myprojectfoler/resources/sqlite3.dll
- i generated sqlite3.lib using visual studio developer command prompt using command
lib /def:sqlite3.def
- i referenced directory lib in project -> preferences -> linker -> general -> additional library directories, , referenced .lib in project -> preferences -> linker -> input-> additional dependencies
- i placed sqlite3.h in project , #included it
(pretty followed instructions seen here)
thank help
the issue default header file assumes sqlite linked statically, opposed dynamic linking dll.
this part of sqlite3.h responsible that:
#ifndef sqlite_api # define sqlite_api #endif
if set per-project define in project properties:
sqlite_api=__declspec(dllimport)
this should resolve link error. alternatively, can put
#define sqlite_api __declspec(dllimport)
right before #include sqlite3.h.
Comments
Post a Comment