求教:
以下代码正确:
[Fortran] 纯文本查看 复制代码 program test
write(*,*) itoa(9)
pause
contains
function itoa(i)
implicit none
character(16) :: itoa
integer,intent(in) :: i
write(itoa,"(I0)") i
return
end function
end
但是一旦把这个函数封装到dll中,
[Fortran] 纯文本查看 复制代码 module test
contains
function itoa(i)
!DEC$ ATTRIBUTES STDCALL,REFERENCE,DLLEXPORT,ALIAS:"itoa"::itoa
implicit none
character(16) :: itoa
integer,intent(in) :: i
write(itoa,"(I0)") i
return
end function
end module
再去调用它就出错了: write(*,*) itoa(9)
出错: Program Exception - access violation
怎么办?
|