1
votes

I have upgraded my Delphi 2007 application to Delphi Seattle. In Delphi 2007 I had a Fortran DLL which was called from my Delphi application. After upgrade I get an error 'Procedure end point not found'. Please note that there is no change to the Fortran DLL and the dll is in the same path as the application exe

The call code from Delphi is

type
  TArrayOfTypeNos= array [1..1000] of Integer;
....
procedure CallFunc(
  Idx : Integer; 
  var Nos : Integer;
  var ProductTypes : TArrayOfTypeNos
); stdcall; external 'MyFortranDLL.dll' name '_ThisIsFuncNameinFortran';

Can someone please give me some idea as to what could be wrong?

The error I get is:

The procedure entry point _ThisIsFuncNameinFortran could not be located in dynamic link library

2
Nothing in the code you present behaves differently in Seattle from how it behaved in 2007. I don't recognise that error message. Please can you quote the error message verbatim, and include a minimal reproducible example. - David Heffernan
The error I get is "The procedure entry point _ThisIsFuncNameinFortran could not be located in dynamic link library" - Jack Gray
@MartynA it is loaded implicitly with load time linking, by the loader, because of this: external 'MyFortranDLL.dll' - David Heffernan
@DavidHeffernan: Thanks, I missed that. - MartynA

2 Answers

2
votes

Nothing has changed between Delphi 2007 and Delphi 10 Seattle that affects the function shown in the question in any way.

The common problems that arise when moving between pre-Unicode Delphi, and Unicode Delphi, relate to differences in the treatment that character and string types. So, Char was formerly an alias to AnsiChar, but is now an alias to WideChar. Likewise for PChar, string etc. But that's not the case here. The types that you use have identical meaning on all Delphi versions from Delphi 2 upwards.

The error message is:

The procedure entry point _ThisIsFuncNameinFortran could not be located in dynamic link library.

There is only one way to interpret that error message. The DLL has been located, but it really does not export a function with that name. Check that the actual DLL loaded really is the one that you intended to load. Dependency Walker, or a similar tool, can probably help.

0
votes

If the DLL really has not changed, this code should have been failing in D2007 to begin with. The fact that it works in 2007 but fails in Seattle likely means the same DLL is not being loaded. You can use a tool like Process Explorer or Process Monitor to see which DLL is actually being loaded. And use Embarcadero's TDUMP utility to see which functions the DLL actually exports.