Linking with MSVC built static library

Mihails a at a.a
Tue Mar 19 16:52:35 UTC 2019


On Saturday, 16 March 2019 at 14:27:55 UTC, kinke wrote:
> On Saturday, 16 March 2019 at 12:03:03 UTC, Mihails wrote:
>> Can't spot anything meaningful in the build log myself :(
>
> Me neither, so I cloned your repo and checked it locally.


Hm, there seems to be one more issue now - it does link but 
resulting program fails during `dub test` with an unrelated stack 
trace:

std.exception.ErrnoException at D:\a\1\s\ldc\ldc2-1.14.0-windows-x64\bin\..\import\std\stdio.d(2977): Enforcement failed (Bad file descriptor)
----------------
0x00007FF771B15369 in std.exception.bailOut!(ErrnoException) at 
D:\a\1\s\ldc\ldc2-1.14.0-windows-x64\import\std\exception.d(516)
0x00007FF771B151F3 in 
std.exception.enforce!(ErrnoException).enforce!int at 
D:\a\1\s\ldc\ldc2-1.14.0-windows-x64\import\std\exception.d(437)
0x00007FF771B1506E in std.stdio.File.LockingTextWriter.put!string 
at D:\a\1\s\ldc\ldc2-1.14.0-windows-x64\import\std\stdio.d(2977)
0x00007FF771B14F46 in std.stdio.writeln!string at 
D:\a\1\s\source\dc\compilers\common.d(3901)
0x00007FF771B1F47D in dub_test_root.D main at 
C:\Users\VSSADM~1\AppData\Local\Temp\dub_test_root_37814547_9f10_4067_8666_bf46365d753b.d(19)
0x00007FF771B3B5AD in void rt.dmain2._d_run_main(int, char**, 
extern (C) int function(char[][])*).runAll()
0x00007FF771B3B44E in d_run_main
0x00007FF771B1FCD7 in __entrypoint.main at 
D:\a\1\s\__entrypoint.d(8)
0x00007FF771B6FA8A in mainCRTStartup
0x00007FF812D684D4 in BaseThreadInitThunk
0x00007FF81523E851 in RtlUserThreadStart
Program exited with code 1

Actual exported C function is not executed here - just making it 
referenced from a dead code of main app is sufficient.

Could there be some code corruption caused by wrong linker flags?


More information about the digitalmars-d-ldc mailing list