替换 DMD 的 kernel32.lib 以包含缺失的函数
我在 Windows 7 上使用 dmd 2.054 和 optlink 8.00.12。
以下程序:
pragma(lib, "kernel32.lib");
extern(Windows) {
uint LocaleNameToLCID(const(wchar)*, int);
}
void main() {
auto us = LocaleNameToLCID("en-US", 0);
}
编译时出错:
Error 42: Symbol Undefined _LocaleNameToLCID@8
但如果我尝试替换 kernel32.lib,我会收到许多错误:
implib /system kernel32.lib \Windows\system32\kernel32.dll
Error 42: Symbol Undefined _LocaleNameToLCID@8
c:\dmd\windows\bin\..\lib\phobos.lib(dmain2)
Error 42: Symbol Undefined _LocalFree@4
c:\dmd\windows\bin\..\lib\phobos.lib(dmain2)
(... snip ...)
查看原始 lib 和为之创建的 implib LocalFree
显示存在差异,但我不确定这意味着什么(此输出中缺少一些特殊字符)
---------- IMPLIB
LocalFree
_LocalFreekernel32.dll LocalFree
_K32GetPerformanceInfo!_LocalFree!Z
_MoveFileExA!É_QueryPerformanceCounter!c_ReadConsoleOutputA!Ó
_LocalFreeZ
---------- DMD'S
LocalFree
[email protected] LocalFree
_LocalFree@4}
知道如何在我的中使用新的 kernel32.lib避免丢失符号的程序?
I'm using dmd 2.054 and optlink 8.00.12 on Windows 7.
The following program:
pragma(lib, "kernel32.lib");
extern(Windows) {
uint LocaleNameToLCID(const(wchar)*, int);
}
void main() {
auto us = LocaleNameToLCID("en-US", 0);
}
Gives an error when compiling:
Error 42: Symbol Undefined _LocaleNameToLCID@8
But if I try to replace kernel32.lib, I get many errors:
implib /system kernel32.lib \Windows\system32\kernel32.dll
Error 42: Symbol Undefined _LocaleNameToLCID@8
c:\dmd\windows\bin\..\lib\phobos.lib(dmain2)
Error 42: Symbol Undefined _LocalFree@4
c:\dmd\windows\bin\..\lib\phobos.lib(dmain2)
(... snip ...)
Looking at the original lib and the implib created for LocalFree
shows there are differences, but I'm not sure what that means (some special characters are missing from this output)
---------- IMPLIB
LocalFree
_LocalFreekernel32.dll LocalFree
_K32GetPerformanceInfo!_LocalFree!Z
_MoveFileExA!É_QueryPerformanceCounter!c_ReadConsoleOutputA!Ó
_LocalFreeZ
---------- DMD'S
LocalFree
[email protected] LocalFree
_LocalFree@4}
Any idea how I can use the new kernel32.lib in my programs to avoid missing symbols?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系..
我之前也尝试过使用
coffimplib
但没有成功,但现在它可以工作了。不知道我之前做了什么。所以我的解决方案是下载 Windows sdk 并在我需要的库上使用
coffimplib
。抱歉收到垃圾邮件。如果有人能告诉我为什么
implib
不起作用,我会接受这个答案。Nevermind..
I had also tried using
coffimplib
earlier without success, but now it works. No idea what I've done earlier.So my solution has been to download the windows sdk and using
coffimplib
on the libraries I need.Sorry for the spam. If someone could tell me why
implib
doesn't work I'll accept that answer.