Don Johnson
11-07-2003, 10:43 PM
In Lahey .NET FORTRAN,
I'm having a problem where I get a linking error when I try to use character arguments in an external module. However, if I use the same routines in the same module, it works fine.
I have one module making calls in another module, both are in .NET.
The error I get is
FRT:2512 Argument of demosub for which the OPTIONAL attribute is not specified must not be omitted.
The external call works with any number of non-character arguments, and also if I place the subroutine in ForLib with the character arguments. Any ideas on why it breaks externally?
Or how to fix it?
ForLib.TopSub calls DemoMod.demosub....code:
module DemoMod
contains
subroutine demosub(intval, charval)
use System
integer*4, intent(in) :: intval
character*(*), reference, intent(in) :: charval
...
end subroutine
end module DemoMod
module ForLib
contains
subroutine TopSub(xxx)
use DemoMod
integer*4 xxx
character*64 charxxx
...
call demosub(xxx,charxxx)
end subroutine
end module ForLib
I'm having a problem where I get a linking error when I try to use character arguments in an external module. However, if I use the same routines in the same module, it works fine.
I have one module making calls in another module, both are in .NET.
The error I get is
FRT:2512 Argument of demosub for which the OPTIONAL attribute is not specified must not be omitted.
The external call works with any number of non-character arguments, and also if I place the subroutine in ForLib with the character arguments. Any ideas on why it breaks externally?
Or how to fix it?
ForLib.TopSub calls DemoMod.demosub....code:
module DemoMod
contains
subroutine demosub(intval, charval)
use System
integer*4, intent(in) :: intval
character*(*), reference, intent(in) :: charval
...
end subroutine
end module DemoMod
module ForLib
contains
subroutine TopSub(xxx)
use DemoMod
integer*4 xxx
character*64 charxxx
...
call demosub(xxx,charxxx)
end subroutine
end module ForLib