This is the code for which this error is occurring when linking on Win7:
https://github.com/pineapplemachine/mach.d/tree/optlink-error-repro
I was experiencing errors with 2.071.2-b6 and the current state of that branch was one where the error was not being produced. Compiling with 2.071.2 should produce the error as-is. To produce the error in 2.071.2-b6, add `unittest{}` to line 14 in mach.d/mach/error/enforce/bounds.d. (The specific line should not particularly matter, but that is where I was placing it while testing myself.)
https://github.com/pineapplemachine/mach.d/blob/optlink-error-repro/mach/error/enforce/bounds.d#L14
In order to reproduce, clone the repository and run the following command:
rdmd -I "path/to/mach.d" -g -main -unittest "path/to/mach.d/mach/error/enforce/bounds.d"
The same optlink error occurs when attempting to run unit tests for modules depending on bounds.d. It does not occur for any of the dependencies of bounds.d.
The optlink error involves this popup: http://puu.sh/tfmBK/c5068eb2fb.png
And this text in stdout/err:
checkpoint(256)
--- errorlevel 1
The text in the popup is this:
EAX=00000010
EBX=0000001C
ECX=00000000
EDX=004337CF
ESI=0044AAE8
EDI=00000100
EBP=0018FF54
ESP=0018FDEC
EIP=0040347E
First=00402000
In addition to adding `unittest{}` to bounds.d, I have also been hitting this same error depending on the addition of seemingly arbitrary method and function calls in other modules, too. When the calls are commented out, the code is successfully compiled.
Comment #1 by bugzilla — 2017-01-09T07:28:58Z
Since this is a linker error, just a zip file with the .obj files and a linker command should be sufficient.