主题:请教在Delphi中调用Fortran Dll出错问题
我在看彭国伦编的Fortran95时,尝试用Delphi调用Fortran编的Dll。但Delphi运行时候,总是提示‘无法定位程序输入点circle_area于动态链接库forlib.dll上’。我尝试把DLL放在Delphi文件下或加上Dll的路径,都未能解决。我想请教一下谁有遇到类似问题的,又怎样解决,谢谢了!
源程序:
forlib.f90:
real function circle_area(radius)
!DEC$ ATTRIBUTES DLLEXPORT ::circle_area
implicit none
real raidus
real, parameter ::pi=3.1415926
circle_area=radius*radius*pi
return
end function
************************
Delphi:
implementation
function circle_area(r:PSingle):Single;stdcall;external'forlib.dll';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
a,s:single;
begin
s:=StrtoFloat(edit1.Text);
a:=circle_area(addr(s));
edit1.Text:=floattostr(a);
end;
end.
源程序:
forlib.f90:
real function circle_area(radius)
!DEC$ ATTRIBUTES DLLEXPORT ::circle_area
implicit none
real raidus
real, parameter ::pi=3.1415926
circle_area=radius*radius*pi
return
end function
************************
Delphi:
implementation
function circle_area(r:PSingle):Single;stdcall;external'forlib.dll';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
a,s:single;
begin
s:=StrtoFloat(edit1.Text);
a:=circle_area(addr(s));
edit1.Text:=floattostr(a);
end;
end.