I am using Salford FTN77/Win32. I want to call a subroutine which is in a (Delphi compiled) DLL file. This subroutine receives a lot of parameters, but I don't want to bother you with this (yet). So I simplified the program to just calling a subroutine without any parameters that produces a system beep.
Beep.dpr (this is the Delphi library that compiles the DLL file):
library MyBeep; uses SysUtils; // Delphi unit SysUtils contains beep procedure procedure PlayBeep; stdcall begin Beep; end; exports PlayBeep; // To export the beep procedure to the DLL. end.
Beeptester.dpr (this is a delphi program creating an executable that can call the procedure from the DLL):
program BeepTester; procedure PlayBeep; external 'Beep.dll'; begin PlayBeep; end.
Beeptester.for (this should be the fortran equivalent of Beeptester.dpr, but it does not work):
program BeepTester
stdcall PlayBeep
call PlayBeep
end
The executable from the fortran code gives an error message:
Error 29, Call to missing routine: _PlayBeep@0 at 0x00401017
This error makes sense to me cause the program can not find the subroutine PlayBeep since I did not specify that it is in 'Beep.dll'.
But how can I fix this problem? In other words, can anyone provide me the FTN77 equivalent of the Delphi code of Beeptester.dpr?
If anyone needs any code (FOR, DPR, DLL, EXE, etc) from me, just drop me a message.