I’m trying to get sqlite3 c-api to compile under windows with code:blocks/gcc mingw compiler as I do successfully on Ubuntu. But can’t get it.
What do I do for now:
Download binary packages, unpack them to c:\sqlite3, put c:\sqlite3 to PATH.
Now I can invoke sqlite3 from cmd window from “anywhere” and this work OK.
In order to using c-api with C I created new folder, prepare library:
dlltool -D sqlite3.dll -d sqlite3.def -l libsqlite3.a
… copy sqlite3.dll, sqlite3.def and sqlite3.h to that folder. In linker settings of project’s build options I add libsqlite3.a but I cant compile program.
Message:
ld.exe||cannot find -lsqlite3|
||=== Build finished: 1 errors, 0 warnings ===|
Please if someone can help to fix this issue.
I find solution by myself 🙂
For described situation is needed to do as described above with dlltool.exe which is in your MinGW/bin directory.
Then copy libsqlite3.a to mingw/lib directory. By me this is:
You can also copy sqlite3.h to:
… to have always ready structure for compiling sqlite3 programs.
In linker settings of project’s build options have to be added “-lsqlite3” (without quotes), and sqlite3.dll should be in the PATH.