[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to call fortran subroution?

"web" <jiali3@21cn.com> writes:

> Thank you very much. I use IDL under windows.
> I have generated vecadd.dll from visual fortran. Then I use
> result = call_external('f:\fortran\vecadd.dll','f:\fortran\vecadd ',  a,
> n_elements(a), x, n_elements(x), b)
> to call the dll. The error message is as following:
> % CALL_EXTERNAL: Error loading sharable executable.
>                  Symbol: f:\fortran\vecadd, File = f:\fortran\vecadd.dll
>                  ERROR_PROC_NOT_FOUND
> But I have dll file under f:\fortran. How to do then? May be I have set
> wrong parameter.
> This is explanation of call_external:
> Result = CALL_EXTERNAL(Image, Entry [, P0, ..., PN-1])
> Entry:A string containing the name of the symbol in the library which is the
> entry point of the routine to be called.
> I donot know how to set entry.

Here ENTRY may be 'vecadd' or 'VECADD' or 'vecadd_' or 'VECADD_'.  The
naming convention depends on your fortran compiler.  The important
thing is tha the entry does *not* include the path, only the name of
the function.  However, I have to admit it's still not clear to me
that you understand the the calling convention of using CALL_EXTERNAL.
You really need to check the EDG.


Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response