Re: Syntax for passing an external function into a contained function?
- From: "robin" <robin_v@xxxxxxxxxxx>
- Date: Thu, 22 Dec 2005 22:46:22 GMT
"ferrad" <acfer@xxxxxxxxxxx> wrote in message
news:1135278019.625007.223310@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I'm trying to call an external function from a contained function in my
> subroutine, but no syntax seems to work, I keep getting unresolved
> externals:
>
> main.for
> external ftest
> call sub1(ftest)
> end
>
> sub1.for
> subroutine sub1(func)
> real*8 func
> x = func1(n)
Do you need to reference func, not func1?
x = func(n) ?
> ...
> contains
> real*8 function func1(n)
> func1 = func(n)
> return
> end
>
> ftest.for
> real*8 function ftest(n)
> ftest = ...
> return
> end
>
> The linker fails saying func is an unresolved external in func1 but it
> shouldn't be looking for func, rather ftest which is in the project.
It's looking for func because you invoked it in func1,
as the message says.
See above.
.
- References:
- Prev by Date: Re: Kind of NOT integer constant
- Next by Date: Need interpretation
- Previous by thread: Re: Syntax for passing an external function into a contained function?
- Next by thread: Scons to build F90, with mixed C. C++
- Index(es):
Relevant Pages
|