On Thursday, 7 June 2018 at 23:25:45 UTC, Steven Schveighoffer wrote:
...

The WinMain exported function works alone well and on 32bit it also does the console. On 64 I also tried AllocConsole, but fail. I get the Console handle with GetConsoleHandle, it sends back a nonzero value.

But as I play with it, now I can broke it even when I only use main() as export.

This bat file runs(dmd and visual-d installed to default c:\d path) (It only affects LDC & win64)
----------------------------------------------------
echo void main(){ import std.stdio; writeln(123); } > test.d
ldmd2 -vcolumns -c -op -allinst -w -m64 -release -O -inline -boundscheck=off test.d
call msvcenv amd64
cd c:\d
link /LIBPATH:C:\d\ldc2\lib64 /OUT:test.exe /MACHINE:X64 /MAP legacy_stdio_definitions.lib test.obj druntime-ldc.lib phobos2-ldc.lib msvcrt.lib
test.exe
----------------------------------------------------

And when I want to run the same exe from outside with totalcommander, it brings up an "application was unable to start: 0xc00000fb exception in a small window o.O.

UPDATE: The exe only starts when "msvcenv.bat amd64" was called before. That enironment setter bat file is needed for the exe as well o.O

I really thank you for trying to help me. Maybe that other different runtime you mentioned is using environment variables to be able to start up. Tomorrow I will test it.

Reply via email to