Cannot link vibe.d sample / optlink error

Radu void at null.pt
Mon Apr 8 14:49:02 UTC 2019


On Monday, 8 April 2019 at 13:42:31 UTC, Michal Minich wrote:
> I used dmd 2.085.0 and 2.085.1 on Win 10
>
> I followed sample at
> https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d
>
> Just the beginning, where you you should compile hello word web 
> app.
>
> command line: "dub"
>
> compilation finishes ok. then it prints "Linking..." and I get 
> window message box:
>
> ---------------------------
> Unexpected OPTLINK Termination at EIP=0040F60A
> ---------------------------
> EAX=073D0000 EBX=00438C70 ECX=00000B2F EDX=0000038A
> ESI=0000008F EDI=073D1344 EBP=0019FF28 ESP=0019FEE0
> First=00402000
> ---------------------------
> OK
> ---------------------------
>
> I also tried clean build with dflags -m32mscoff. But then I get 
> another kind of errors.
>
> Any help moving forward is appreciated.

Hi there,
Compiling with 2.085.1 on Windows 10 works with `dub 
--arch=x86_mscoff`
LDC 1.15.0 works for x86/x86_64. Tested also on a fresh VMWare 
instance running Windows 7.

You can try running it with `dub --arch=x86_mscoff --verbose` in 
order to get more diagnostic messages for build errors.

Make sure you have "Visual C++ Redistributable for Visual Studio 
2015" installed, it is required to be able to run the produced 
executable, if you don't build it using the Visual Studio command 
line. The reason is that both DMD and LDC will use the MinGW 
`.lib` files, which require a dynamic linked C runtime (static 
linking is permitted only with Visual Studio)


More information about the Digitalmars-d-learn mailing list