加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

DLL – 如何在Windows上的D语言程序中使用SQLite库?

发布时间:2020-12-14 02:03:53 所属栏目:Windows 来源:网络整理
导读:如何在 Windows上的D语言程序中使用SQLite3库? 我在Ubuntu上找到了similar question,但在我的情况下它没有用. import std.stdio,std.string,etc.c.sqlite3;void main () { sqlite3* db; auto ret = sqlite3_open (toStringz("mydb.s3db"),db); writeln (ret
如何在 Windows上的D语言程序中使用SQLite3库?

我在Ubuntu上找到了similar question,但在我的情况下它没有用.

import std.stdio,std.string,etc.c.sqlite3;

void main () {
  sqlite3* db;
  auto ret = sqlite3_open (toStringz("mydb.s3db"),&db);
  writeln (ret);
}

我假设,sqlite3.d是真正的SQLite3库的某种标头.我有一个sqlite3.dll,但我不知道如何将它与我的程序链接. pragma仅适用于lib formate(如pragma(lib,“sqlite3”)).

也许我应该使用SQLite源代码,但是如何将它与D代码一起编译呢?或者找到将dll转换为lib的方法更好?

在D中解决这些问题的一般方法是什么?

解决方法

Or is it better to find some way to convert dll to lib?

是.从问题Statically linking SQLite with DMD (Windows x86)开始,只需使用/ system开关通过implib运行.dll文件(与生成的.lib文件链接仍将导致动态链接和对.dll文件的依赖).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读