Binary not found

delphi package - automated exception handling
Post Reply
mikerabat
Posts: 8
Joined: Thu Oct 22, 2009 2:40 pm

Binary not found

Post by mikerabat »

Hey all!

I'm currently using 4.0.21 and we are upgrading to Delphi 10.4

In this process I noticed that during the building of our apache shared library I encounter a
"Binary not found" warning from madExcept.

I tried to debug that and ran the madExcept wizzard in a second Delphi IDE so I can debug into that...
Story short the line
{$ifdef d2005}
binary := IOTAProject(FPrj).ProjectOptions.GetTargetName;
{$endif}
actually returns the wrong binary file name.

You need to know that we add the following compiler directives to the main project file
{$E so} // change suffix from dll to so
{$LIBPREFIX 'mod_'}

to be more "compatible" with the stanard apache name convention.

Here is a stub code that shows that problem:

Code: Select all

library Project1;

uses
  madExcept,
  System.SysUtils,
  System.Classes;

{$R *.res}

{$E so} // change suffix from dll to so
{$LIBPREFIX 'mod_'}

function Test12(var x : integer) : boolean;
begin
     inc(x);
     Result := x > 0;
end;

exports
  Test12;

begin
end.
So...
I guess it's a Delphi 10.4 problem since the project is not updated the same way as Delphi2010 did - the project name in the project
overview actually changed to the desired filename wheras in delphi 10.4 this stays as project1.dll instead of mod_project1.so.

But is there a solution for that in Delphi10.4 or can I change the mad except wizzard's code in such a way that it works?

kind regards
Mike
madshi
Site Admin
Posts: 10528
Joined: Sun Mar 21, 2004 5:25 pm

Re: Binary not found

Post by madshi »

Sounds like as bug in Delphi 10.4? You might want to report it to Embarcadero.

You can workaround it by doing this:

1) Add a "// dontTouchUses" comment to the dpr file, ideally above the uses clause.
2) Disable madExcept for the project.
3) Manually call madExceptPatch.exe in the post build events with the proper suffix file name.
mikerabat
Posts: 8
Joined: Thu Oct 22, 2009 2:40 pm

Re: Binary not found

Post by mikerabat »

ok I see - anyway is there a fix for that in version 5 of your lib or weren't there any changes in the IDE code...
madshi
Site Admin
Posts: 10528
Joined: Sun Mar 21, 2004 5:25 pm

Re: Binary not found

Post by madshi »

There's no change in this area in v5.
mikerabat
Posts: 8
Joined: Thu Oct 22, 2009 2:40 pm

Re: Binary not found

Post by mikerabat »

Ok I guess this is already something long onging at Embarcadero/Idero
I found several entries in the QC database e.g. https://quality.embarcadero.com/browse/RSP-15996
which I guess has the same base...
I made a comment there and hope that is engough but I'm sure if a delphi heavy weight like you would also
intervene here a bit it would definitely help ;)
Hey and... thanks for the great exception handler ;)
Post Reply