简体   繁体   English

SQLite3,C-API,在Windows上安装

[英]Sqlite3, c-api, installing on windows

I'm trying to get sqlite3 c-api to compile under windows with code:blocks/gcc mingw compiler as I do successfully on Ubuntu. 我正在尝试使sqlite3 c-api在Windows下使用code:blocks / gcc mingw编译器在Windows下编译,就像我在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. 下载二进制软件包,将其解压缩到c:\\ sqlite3,然后将c:\\ sqlite3放入PATH。
Now I can invoke sqlite3 from cmd window from "anywhere" and this work OK. 现在,我可以从“任何地方”从cmd窗口调用sqlite3,并且工作正常。

In order to using c-api with CI created new folder, prepare library: 为了通过CI创建新文件夹使用c-api,请准备库:

dlltool -D sqlite3.dll -d sqlite3.def -l libsqlite3.a

... copy sqlite3.dll, sqlite3.def and sqlite3.h to that folder. ...将sqlite3.dll,sqlite3.def和sqlite3.h复制到该文件夹​​。 In linker settings of project's build options I add libsqlite3.a but I cant compile program. 在项目的构建选项的链接器设置中,我添加了libsqlite3.a,但无法编译程序。

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. 对于上述情况,需要使用MinGW / bin目录中的dlltool.exe如上所述进行操作。
Then copy libsqlite3.a to mingw/lib directory. 然后将libsqlite3.a复制到mingw / lib目录。 By me this is: 对我来说是:

C:\\Program Files (x86)\\CodeBlocks\\MinGW\\lib C:\\ Program Files(x86)\\ CodeBlocks \\ MinGW \\ lib

You can also copy sqlite3.h to: 您也可以将sqlite3.h复制到:

C:\\Program Files (x86)\\CodeBlocks\\MinGW\\include C:\\ Program Files(x86)\\ CodeBlocks \\ MinGW \\ include

... to have always ready structure for compiling sqlite3 programs. ...具有随时准备用于编译sqlite3程序的结构。

In linker settings of project's build options have to be added "-lsqlite3" (without quotes), and sqlite3.dll should be in the PATH. 在项目的构建选项的链接器设置中,必须添加“ -lsqlite3”(不带引号),并且sqlite3.dll应该位于PATH中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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