[疑难] D语言动态库,导出规则.
sdv
2011-12-01
import core.runtime; import core.sys.windows.windows; import core.sys.windows.dll; //import mach3plugins; __gshared HINSTANCE g_hInst; extern (Windows) BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved) { switch (ulReason) { case DLL_PROCESS_ATTACH: g_hInst = hInstance; dll_process_attach( hInstance, true ); break; case DLL_PROCESS_DETACH: dll_process_detach( hInstance, true ); break; case DLL_THREAD_ATTACH: dll_thread_attach( true, true ); break; case DLL_THREAD_DETACH: dll_thread_detach( true, true ); break; default: } return true; } //D, C, C++, Pascal, Windows, System extern (C) export void MyVer1() { } extern (C) export void MyVer2() { } 这个基本的D文档应该会导出怎样的? 我测试实际是导出了 _MyVer1 MyVer2 D2 2.056 这会是什么原因导致的? |
|
flythink
2011-12-02
确实如此, 用def文件试试吧
|
|
sdv
2011-12-02
不用尝试了 bug一个~,查阅到了
现在就是optlink的bug非常的烦 短短一个程序遇到两个 |