I would guess that using the .def file would be easier. You can add a prebuild command to the settings that would run dlltool to produce the .def file
dlltool -z libname.def --export-all-symbols $(OBJS)
Once you have this file I believe you just pass it into gfortran when you build the library. I'm not at a computer with Photran today so I can't play with it at the moment. When I tried last night, I was able to get a working dll without having to use DLL_EXPORT or a def file, but then again I only made a very simple library.
Keith Prussing
--- On Fri, 4/30/10, DEVEL Michel <Michel.Devel@xxxxxxxx> wrote:
From: DEVEL Michel <Michel.Devel@xxxxxxxx> Subject: Re: [photran] How to
build a Windows DLL from a fortran code with To: "Keith Prussing" <kprussing74@xxxxxxxxx>, "Photran Information" <photran@xxxxxxxxxxx> Date: Friday, April 30, 2010, 8:28 AM
I recently got a 72 ko fortran code full of subroutines that is usually transformed into a Windows DLL by Lahey Fortran 90 (using DLL_EXPORT lines in the code)
Well in fact, it still does not work: the dll is created but since I do
not know what to put instead of the DLL_EXPORT lines in the fortran
code, none of the fortran routines is exported (with the program
"depends" I could see that there are only 1.3 MB of windows stuff)...
Googling a bit I have seen $DECL stuffs and .def files, which one is
the easiest to learn ?
--
Sincerely yours,
Michel DEVEL
|