当前位置:网站首页>D为何链接不了dll
D为何链接不了dll
2022-07-02 10:00:00 【fqbqrr】
module dimedll;
import core.sys.windows.windows;
import core.sys.windows.dll; // 用途?
import std.stdio;
mixin SimpleDllMain;
export void testFunc() {
writeln("DLL内容");
}
//有了`dimedll.dll`和`dimedll.lib`
测试:
//dime.d
import std.stdio;
import core.sys.windows.windows;
import std.stdio : log = writeln;
pragma(lib, "dimedll.lib");
extern void testFunc();
void main() {
log("构建ime");
testFunc();
}
用dmd -i -run dime.d编译出错.
参考地址
只需要标记导出内容并确保名称匹配(包括模块名).方法是删除extern声明.
除非使用optlink作为链接器,不需要.def文件,(原则上,应使用lld或ld代替.)
边栏推荐
猜你喜欢

JS iterator generator asynchronous code processing promise+ generator - > await/async

SAP MM 因物料有负库存导致MMPV开账期失败问题之对策

诚邀青年创作者,一起在元宇宙里与投资人、创业者交流人生如何做选择……...

Ltc3307ahv meets EMI standard, step-down converter qca7005-al33 phy

完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。

Domestic free data warehouse ETL dispatching automation operation and maintenance expert taskctl

Unity SKFramework框架(十二)、Score 计分模块
![Jerry's watch stops ringing [article]](/img/28/8a225b77b19360d2b0077a2b8c4b6d.jpg)
Jerry's watch stops ringing [article]
![[opencv learning] [image histogram and equalization]](/img/e7/b8dc55a9febf2b2949fce3a7ac21f9.jpg)
[opencv learning] [image histogram and equalization]

Web Foundation
随机推荐
Unity skframework framework (XXI), texture filter map resource filtering tool
Unity SKFramework框架(十六)、Package Manager 开发工具包管理器
JS reverse row query data decryption
[opencv learning] [contour detection]
What are eNB, EPC and PGW?
Ruby: how to copy variables without pointing to the same object- Ruby: how can I copy a variable without pointing to the same object?
[opencv learning] [Canny edge detection]
PXE installation UOS prompt NFS over TCP not available from 10 x.x.x
SAP MM 因物料有负库存导致MMPV开账期失败问题之对策
Japan bet on national luck: Web3.0, anyway, is not the first time to fail!
Word efficiency guide - word's own template
Js5day (event monitoring, function assignment to variables, callback function, environment object this, select all, invert selection cases, tab column cases)
linux下清理系统缓存并释放内存
EasyDSS点播服务分享时间出错如何修改?
mac(macos Monterey12.2 m1) 个人使用php开发
Hundreds of web page special effects can be used. Don't you come and have a look?
嵌入式软件开发
[200 opencv routines] 100 Adaptive local noise reduction filter
自主可控三维云CAD:CrownCAD赋能企业创新设计
How to modify the error of easydss on demand service sharing time?