www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Linker error on Windows - Is there a bug fix / work around?

reply Kai Nacke <kai redstar.de> writes:
Hi!

I only rarely use dmd so forgive me if this is a known issue.

If you compile the Chapter4\noteapp2 application on Windows from 
my book (using dmd 2.071.0) then you get the error:

OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\application-debug-windows-x86-dmd_2071-B4EE3FC00CF6CA600F2FCC18096C25E0\no
eapp2.obj(noteapp2)  Offset 29B9AH Record Type 009D
  Error 16: Index Range
--- errorlevel 1

How can I work around this error? The application compiles & runs 
fine on Linux.
Would it be worth to try to use -mscoff?

Regards,
Kai
Apr 25 2016
next sibling parent Jesse Phillips <Jesse.K.Phillips+D gmail.com> writes:
On Monday, 25 April 2016 at 11:08:56 UTC, Kai Nacke wrote:
 Hi!

 I only rarely use dmd so forgive me if this is a known issue.

 If you compile the Chapter4\noteapp2 application on Windows 
 from my book (using dmd 2.071.0) then you get the error:

 OPTLINK (R) for Win32  Release 8.00.17
 Copyright (C) Digital Mars 1989-2013  All rights reserved.
 http://www.digitalmars.com/ctg/optlink.html
 .dub\build\application-debug-windows-x86-dmd_2071-B4EE3FC00CF6CA600F2FCC18096C25E0\no
eapp2.obj(noteapp2)  Offset 29B9AH Record Type 009D
  Error 16: Index Range
 --- errorlevel 1

 How can I work around this error? The application compiles & 
 runs fine on Linux.
 Would it be worth to try to use -mscoff?

 Regards,
 Kai
I don't know this error, but I would recommend -m64 or -m32mscoff as a work around. If you have problems with the linker finding files you can use the Developer Command Prompt and the environment should be setup correctly.
Apr 25 2016
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 4/25/2016 4:08 AM, Kai Nacke wrote:
 If you compile the Chapter4\noteapp2 application on Windows from my book (using
 dmd 2.071.0) then you get the error:

 OPTLINK (R) for Win32  Release 8.00.17
 Copyright (C) Digital Mars 1989-2013  All rights reserved.
 http://www.digitalmars.com/ctg/optlink.html
 .dub\build\application-debug-windows-x86-dmd_2071-B4EE3FC00CF6CA600F2FCC18096C25E0\noteapp2.obj(noteapp2)
 Offset 29B9AH Record Type 009D
   Error 16: Index Range
 --- errorlevel 1
That's a corrupt object file, i.e. a compiler bug. Please submit a reproducible example to Bugzilla.
Apr 25 2016