d引用未解析符号
import core.runtime;
import std.stdio;
import std.string;
import core.sys.windows.windows;
extern(Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR cmdLine, int nCmdShow) {
int result;
try {
Runtime.initialize();
result = myWinMain(hInstance, hPrevInstance, cmdLine, nCmdShow);
Runtime.terminate();
} catch (Throwable e) {
result = 0;
}
return result;
}
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR cmdLine, int nCmdShow) {
MessageBox(null, "Hello", "D!", MB_OK);
return 0;
}
你可能忘记链接到user32.代码中加入:
pragma(lib, "User32");
浙公网安备 33010602011771号