Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

delphi package - automated exception handling
Post Reply
Daverick
Posts: 6
Joined: Thu Jan 16, 2025 3:48 pm

Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by Daverick »

I compiled my project with Delphi 12.2 on 64bits in Runtime, then when I start my program I get a dialog saying:
The procedure entry point "__init_record_Madstacktrace" was not found in the DLL "Core.bpl".
I also had similar errors with other components and fixed them by upgrading the package to a newer version that supports the new changes in Delphi. Could it be that this is the case here as well?
Because in 32 bits is working perfectly
madshi
Site Admin
Posts: 10843
Joined: Sun Mar 21, 2004 5:25 pm

Re: Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by madshi »

Delphi 12.2 is supposed to be downwards compatible to 12.0. So I'm not sure what's going on there.

Can you reproduce this issue with a brand new (nearly empty) test project?
Daverick
Posts: 6
Joined: Thu Jan 16, 2025 3:48 pm

Re: Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by Daverick »

Hi madshi,
I have made a demo for you. I added all the needed .bpls to the Output path directory, which looks like this:
2025-01-20 11_41_02-Debug - FreeCommander XE.png
2025-01-20 11_41_02-Debug - FreeCommander XE.png (9.37 KiB) Viewed 515 times
In this case I got the error with "__init_record_MadTypes", here is the zip:
Demo.zip
(77.81 KiB) Not downloaded yet
Daverick
Posts: 6
Joined: Thu Jan 16, 2025 3:48 pm

Re: Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by Daverick »

I forgot to mention, those are the settings I am using:
2025-01-21 14_43_54-madExcept 5.1.5 settings  ·  Project1.dproj.png
2025-01-21 14_43_54-madExcept 5.1.5 settings · Project1.dproj.png (34.59 KiB) Viewed 488 times
If I throw the exception in the .exe, it will work:
2025-01-21 14_47_35-Project1 - Delphi 12 - MyProgramm [Running].png
2025-01-21 14_47_35-Project1 - Delphi 12 - MyProgramm [Running].png (47.8 KiB) Viewed 488 times
But if I use the Package1.bpl, I get this error:
2025-01-21 14_50_57-Package1 - Delphi 12 - Unit1 [Running].png
2025-01-21 14_50_57-Package1 - Delphi 12 - Unit1 [Running].png (8.12 KiB) Viewed 488 times
I don't know what else can I do or try...
Daverick
Posts: 6
Joined: Thu Jan 16, 2025 3:48 pm

Re: Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by Daverick »

Hi madshi,
I just saw, that you can actually reproduce this error with your demo in Delphi 12.2. Instead of exporting a .dll import it as uses from Delphi itself.
Anyway, I found out that this error is happening when I write those uses in the Package1:
2025-01-30 09_10_05-Package1 - Delphi 12 - Unit1.png
2025-01-30 09_10_05-Package1 - Delphi 12 - Unit1.png (73.22 KiB) Viewed 384 times
If I comment out those uses, then it works:
2025-01-28 15_41_36-Package1 - Delphi 12 - Unit1.png
2025-01-28 15_41_36-Package1 - Delphi 12 - Unit1.png (82.95 KiB) Viewed 384 times
Does the mistake come from Delphi compiler itself?
madshi
Site Admin
Posts: 10843
Joined: Sun Mar 21, 2004 5:25 pm

Re: Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by madshi »

Hi there,

and sorry for the late reply. I've now installed Delphi 12.2, and then installed Patch 1 via the GetIt package manager. But I can't find a Patch 2 anywhere? When I try to compile your project, it fails because of a missing GetIt package dependency that seems not possible to resolve.

Any ideas? Why does your demo project have a GetIt dependency? That seems rather weird?
Daverick
Posts: 6
Joined: Thu Jan 16, 2025 3:48 pm

Re: Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by Daverick »

Hi madshi,
Thank you for you reply.
The dependency isn't actually needed, I was just testing to see if it would work with it, but it didn't work with or without it and I forgot to remove it
madshi
Site Admin
Posts: 10843
Joined: Sun Mar 21, 2004 5:25 pm

Re: Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by madshi »

Ok, so I've compiled your project and copied in madBasic_.bpl, madDisAsm_.bpl and madExcept_.bpl, and it works just fine for me, just as long as I don't activate madExcept for the Project1.bpl. Is there a specific reason why you want to do that? The usual approach is to just enable madExcept in the EXE file, and that should work fine for the Project1.bpl, as well. So there's no real need to activate madExcept for the Project1.bpl, as well.

That said, I've no idea why the issue occurs - which I *can* reproduce if I activate madExcept in Project1.bpl. For some reason, Delphi adds a link to Project1.bpl to an export from madBasic_.bpl which doesn't exist. Which is really strange. This looks like a bug in Delphi to me. But on the other hand, I have not recompiled madExcept with Delphi 12.2 yet. Maybe the problem goes away if I do that. But I fear if that is the case, maybe it will break Delphi 12.1 or Delphi 12.0? I don't really know.
Daverick
Posts: 6
Joined: Thu Jan 16, 2025 3:48 pm

Re: Entry point not found after compiling in 64 bits with Delphi 12.2 patch 2

Post by Daverick »

We use madExcept in a .bpl where we wrote some own classes to handle memory leaks and exceptions and then we use this package throughout our application (other .bpls and .exe inclusive). It would be helpful if you could provide us a compiled version in Delphi 12.2 so that I can test it and see if it works.
Post Reply