|
From: Jason C. <ja...@so...> - 2001-08-06 18:43:04
|
> -----Original Message-----
> From: min...@li...
> [mailto:min...@li...]On Behalf Of Matthew
> Brett
> Sent: Sunday, August 05, 2001 7:58 PM
> To: min...@li...
> Subject: [Mingw-users] Linking to a DLL from g77 - name decoration
> problems
>
> LIBRARY thing.dll
> EXPORTS
> FUNCTION1@8
> FUNCTION2@12
>
> and so on.
>
> I generate a library for linking to the dll with
>
> dlltool --input-def thing.def --output-lib thing.a
>
> In the code I am trying to compile, the function calls
> in the code read as:
>
> CALL FUNCTION1('Some string')
>
> etc. My first problem is that the standard calling
> convention is cdecl; I think this can only be solved
> for g77 by compiling with the -mrtd option. This
> leads to my second problem, which is that the
> externals generated by the compiler are not decorated;
> ie I think the external needed is FUNCTION1@8, but in
> fact the -mrtd option generates FUNCTION1, which then
> will not link to the link library for the DLL. Is
> there a way to modify the externals generated by the
> compiler, or used in the import library, or somehow
> aliasing them, so that they will link, and still call
> the correct function in the DLL?
Hmm, I don't know much at all about FORTRAN (although I do notice it seems
to like capital letters for some reason), but try adding -k to the dlltool
command line, or --add-stdcall-alias, they might be what you need.
--Jason Craig
|