For some reason, LINK.EXE is refusing to build a debug version of my code. I keep getting the following message:

msvcrt.lib(chkstk.obj) : error : Internal error during Pass2

ExceptionCode = C0000005
ExceptionFlags = 00000000
ExceptionAddress = 65AEB479
NumberParameters = 00000002
ExceptionInformation[ 0] = 00000000
ExceptionInformation[ 1] = 00000014

Eax = 00000000 Esp = 0012F2B8
Ebx = 01125D08 Ebp = 0012F2C8
Ecx = 00000000 Esi = 01125D08
Edx = 01040009 Edi = 00000000
Eip = 65AEB479 EFlags = 00010256
SegCs = 0000001B SegDs = 00000023
SegSs = 00000023 SegEs = 00000023
SegFs = 00000038 SegGs = 00000000
Dr0 = 0012F2B8 Dr3 = 01125D08
Dr1 = 0012F2C8 Dr6 = 00000000
Dr2 = 00000000 Dr7 = 00000000

This only happens when I try to link with the /DEBUG option. However, normal linking of the same code also generates a linker warning:

LINK : warning LNK4089: all references to "gdi32.dll" discarded by /OPT:REF

I don't think the two are related, as they involve different libraries. Has anyone else had these problems? And if so, how do I fix them?
Posted on 2003-10-05 00:57:22 by Tatterdemalian
Error LNK4089 just means that you have included a library and not used any functions from that library. In this case you have included the GDI32 library and not called any GDI32 commands, you can either remove the include/includelib lines from your code or add /IGNORE:4089 to the link command line.

For the first problem, I don't use the msvcrt library so I don't know what the problem could be.
Posted on 2003-10-05 01:26:12 by donkey
I figured it was something like that. Unfortunately, while my source code doesn't use gdi32.lib, the d3dx9.lib file does, or at least one function from that library (DeleteObject). So leaving it out isn't an option.

Anyone else know anything about msvcrt.lib? I hate the damn thing, but the other libs I have to use rely on it heavily.
Posted on 2003-10-05 03:26:27 by Tatterdemalian