Subject: Re: Mingw32, g77 and B20
From: [email-masked] (Earnie Boyd)

10 Nov 1998 01:56:12 -0800
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: Guido Masarotto <[email-masked]>, [email-masked]

---Guido Masarotto <[email-masked]> wrote:
>
> I have recently ported a statistical program (R = "Gnu S") using
> egcs-mingw32 (http://www.ci.tuwien.ac.at/R/contents.html).
> 
> R require both C and Fortran. Today, I tried to recompile it
> using B20 + the g77 add-on made available by Mumit Khan.
> I used the mingw32 flag (-mno-cygwin) after adjusting `specs'
> (as discussed by many messages in these days).
> Compilation was ok but linking gave a lot of unresolved symbols.
> The problem is that the Fortran library in the Mumit's add-on
> (libg2c) is for Cygwin not for Mingw32.
> Next, I linked not against the B20 libg2c but against the
> egcs-1.1-mingw32 libg2c (theory: it is the same version of egcs,
> the libraries must be the same, this last one is built for 
> Mingw32). Linking was okay and R seems to work ok
> (also some dll's (mixing Fortran and C) dyn.loaded by R at runtime).
> 
> Question is: is this reliable? Or, what must be done to use
> Fortran with Mingw32 and B20?
> 

If the library was built using the cygwin headers then it will require
the use of the cygwin libraries.  If the library was built using the
mingw32 headers then it will require the use of the crtdll libraries. 
Which library to use is controlled via the specs file based on the
-mno-cygwin switch.  Now if you want libraries of the same name to use
with the different headers you'll have to decide if you want to name
the libraries differently, (i.e.: libg2c-cygwin and libg2c-mingw32) or
if you want to create a directory named mingw32 in the lib/ directory
and figure out how to change the specs file to use the appropriate
directory based on the -mno-cygwin switch.

Both methods have pro's and con's but you have to decide which is best
for you.  As for reliability, I believe that they are equal in
reliability.  The real question is, do you want to be forced to make
your source code OpenSource under the GNU copyright?  And, are you
porting UNIX code or are you just creating your own?  If you're
porting UNIX then it might be best to use cygwin.  If you're writing
fresh code or if you want proprietary source code then it is probably
best to use mingw32.

==
-                  \\||//
-------------o0O0--Earnie--0O0o--------------
--          [email-masked]          --
-- http://www.freeyellow.com/members5/gw32 --
----------------ooo0O--O0ooo-----------------

PS: Newbie's, you should visit my page.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".