Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] How to build a Windows DLL from a fortran code with

Okay I played with it a little bit and figured it out. Once you have an automatic makefile project ready,go to Project->Properties->Fortran build->Settings. 
Under the Tools Settings tab select Miscellaneous under GNU Fortran Linker and add 
"-shared -mrtd" to the Linker Flags box. Then go over to the Build Artifact tab 
and set the Artifact extension to .dll (I had to type it in). Set a prefix if 
desired and you are ready to build a .dll.

Keith Prussing


Message: 1
Date: Thu, 29 Apr 2010 11:52:07 +0200
From: DEVEL Michel <Michel.Devel@xxxxxxxx>
Subject: [photran] How to build a Windows DLL from a fortran code with
	photran/gfortran ?
To: Photran Information <photran@xxxxxxxxxxx>
Message-ID: <4BD956C7.9050100@xxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Dear photran users and developers,

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)
Could anyone tell me how I could do the same with photran ?
(I already tried using a "shared library type" project, with MinGW GCC
tool chain and could get foo.o (once the DLL_EXPORT were commented
out...), but the later command
gfortran -o foo.dll foo.o
does complain about "undefined reference to `MAIN__' which is normal
since there is no main program.
Under Linux I would think I would have had a ranlib or ar line instead
of this gfortran line...

It is the first time I try to build a Windows DLL so that I do not know
the specific flags/steps to build a dll.

-- 

Sincerely yours,

Michel DEVEL



      



Back to the top