windows - 如何编译要从 DMD 链接的 msvc 静态库?

标签 windows visual-c++ d dmd

我一直在花费大量时间尝试为开源 C 库构建 D 绑定(bind)。

我正在使用 msvc 将 C 构建为静态 .lib,但 DMD 无法识别 .lib 文件,这似乎是与 COFF/OMF 不兼容相关的问题。

编译与 OMF 兼容的 C 库以从 D 链接的最简单方法是什么?

最佳答案

将头文件移植到具有匹配函数签名和extern (C).di 文件中。然后将其用作 import 目标。您可以使用 htod tool帮助解决这个问题。

参见 http://dlang.org/spec/interfaceToC.html

关于windows - 如何编译要从 DMD 链接的 msvc 静态库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34289414/

相关文章:

c++ - dev-cpp 和 Microsoft Visual C++ math.h 的区别

d - 预编译的 Windows OMF BLAS/LAPACK?

linux - PowerPC Linux 上的 D(和 Tango)

windows - 如何在 Windows 上模拟 shm_open?

windows - 如何将版本和源信息添加到 powershell 别名?

windows - 在 Windows 中激活 conda 环境时如何更改目录

d - 基于 D 中的关联数组排序

python - 在 python 中使用 Windows shell '>' 将输出重定向到文本文件

windows - mfc 应用程序中的 "binary was not built with debug information "警告含义?

visual-studio-2010 - 如何在项目中定位(和删除)MFC 相关代码?