Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

while debugging with Environment Variable "The program can't start because ....dll is missing"

I get the error mentioned further on error when debugging an executable in Delphi XE2 update 4 under these circumstances:

  • that depends on mqic.dll from WebShpere that is in C:\Program Files \IBM\WebSphere MQ\bin\mqic.dll and C:\Program Files\IBM\WebSphere MQ\bin is on the system path (not on the user path).
  • is being debugged with an override environment variable in the Run -> Parameters -> Debugger -> Environment Block -> User overrides
  • Including System Variables on the same property page is checked

This is the error (it's a Windows DLL load error marked "System Error").

The program can't start because mqic.dll is missing from your computer. Try reinstalling the program to fix this problem.

A few notes:

  • I debug as regular user (which is normal practice anyway, but in this case, I can't be administrator because of policies at the client).
  • As soon as I remove the environment variable, it works (but the program barfs as it really needs the info).
  • Specifying the environment variable before Delphi starts is cumbersome, but doable as a temporary workaround (I need to change that variable often while debugging to test different scenario's; the startup/shutdown times of Delphi makes this tedious).
  • I cannot do without the environment variable because it is required for an application where there is no source code for and cannot be rewritten in time for it to be phased out anyway

This is what the event log shows:

Faulting application name: CAS400NTMQ.exe, version: 1.1.4639.52512, time stamp: 0x50508180
Faulting module name: ntdll.dll, version: 6.1.7601.17725, time stamp: 0x4ec49b60
Exception code: 0xc0000005
Fault offset: 0x0005333f
Faulting process id: 0x4b20
Faulting application start time: 0x01cd90e36bb90816
Faulting application path: C:\Users\...\bin\CAS400NTMQ.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: a9853965-fcd6-11e1-ae66-78e3b5ca2514

Question: is there another solution or easier workaround than what I'm using above?

like image 791
Jeroen Wiert Pluimers Avatar asked Dec 20 '22 16:12

Jeroen Wiert Pluimers


1 Answers

According to Andreas Hausladen's latest blog post, and his answer here, this XE2 bug is taken care of by IDEFixPack. And is not needed in XE3 since XE3 fixes the problem.

So I suspect that may be the most effective workaround if you can manage to get IDEFixPack installed on this machine. Even if you can't get IDEFixPack installed, then this answer could still be useful to other readers.

like image 72
David Heffernan Avatar answered Dec 24 '22 02:12

David Heffernan