Re: c calling a fortran subroutine
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Fri, 1 Jul 2005 14:17:22 -0700
RichN wrote:
> hi Carl,
>
> I am able, now, to run dumpbin at my PC. In any case, I ran /EXPORTS,
> and got the following:
>
> Dump of file sftck3.lib
> File Type: LIBRARY
> Exports
> ordinal name
> _SFTCK3
>
> Summary
> C3 .debug$S
> 14 .idata$2
> 14 .idata$3
> 4 .idata$4
> 4 .idata$5
> C .idata$6
>
> I checked this against a known working DLL I previously created in C,
> and the output
> is similar. So now I'm thinking that the subroutine name is there,
> but that the original error "unresolved external symbol _SFTCK3@0" is
> indicating the function name is undefined to the function that is
> calling it. Normally, in C, I would have some kind of #include
> "xxxxxxxx" to define SFTCK3. Do I need some type of .h to go with my
> fortran dll?
OK, so your C code is expecting a function with the normal __stdcall name
decorations (_name@paramSize), while your Fortran DLL exported only a simple
name.
Are you sure that the Fortran code is __stdcall? It's named as if it's
__cdecl. Try changing your extern declaration in the C module to use
__cdecl. That'll probably make it link - if the Fortran function doesn't
actually __cdecl, then the mismatch will likely cause the program to crash
shortly after returning from the Fortran sub.
-cd
.
- Follow-Ups:
- Re: c calling a fortran subroutine
- From: RichN
- Re: c calling a fortran subroutine
- References:
- Re: c calling a fortran subroutine
- From: RichN
- Re: c calling a fortran subroutine
- From: Carl Daniel [VC++ MVP]
- Re: c calling a fortran subroutine
- From: RichN
- Re: c calling a fortran subroutine
- Prev by Date: RE: insert jpg picture in dialog
- Next by Date: Re: I'm a beginner
- Previous by thread: Re: c calling a fortran subroutine
- Next by thread: Re: c calling a fortran subroutine
- Index(es):
Relevant Pages
|