Incomprehensible compiler errors

Stuart stugol at gmx.com
Mon Jul 30 12:45:59 PDT 2012


On Monday, 30 July 2012 at 19:03:13 UTC, Dmitry Olshansky wrote:
> Why would you use internal module of library is beyond me

Perhaps because nobody saw fit to define IsWindow() in module 
"core.sys.windows.windows"?

> dmd your_module.d dfl.lib

No, that doesn't help. Because I'm getting this same shit when I 
import my OWN .d files:

---

module infinity.standard.runtime.IApp;
interface IApp { int Run(); }

---

module infinity.standard.runtime.StandardApplication;
import infinity.standard.runtime.IApp;

mixin template StandardApplication(TApp : IApp) {
	import core.runtime, core.sys.windows.windows;
	extern (Windows)
	int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR 
lpCmdLine, int nCmdShow) {
		 int result;
		 void exceptionHandler(Throwable e) { throw e; }
		 try {
			  Runtime.initialize(&exceptionHandler);
			  result = myWinMain(hInstance, hPrevInstance, lpCmdLine, 
nCmdShow);
			  Runtime.terminate(&exceptionHandler);
		 } catch (Throwable o) {
			  MessageBoxA(null, cast(char *)o.toString(), "Error", MB_OK | 
MB_ICONEXCLAMATION);
			  result = 0;		// failed
		 }
		 return result;
	}

	int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
LPSTR lpCmdLine, int nCmdShow) {
		TApp app;
		return app.Run();
	}
}
---

Error 42: Symbol Undefined 
_D8infinity8standard7runtime4IApp4IApp11__InterfaceZ



More information about the Digitalmars-d mailing list