delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/19/11:48:39

From: cateland AT adersa DOT asso DOT fr (Stephane Cateland)
Subject: Re: G77 fork problems
19 Jan 1999 11:48:39 -0800 :
Message-ID: <3512E53223A.cygnus.gnu-win32@panoramix.adersa.asso.fr>
References: <36A37EBC DOT C60EF81D AT inspirepharm DOT com>
Reply-To: cateland AT adersa DOT asso DOT fr
Mime-Version: 1.0
To: "Suhaib M. Siddiqi" <ssiddiqi AT inspirepharm DOT com>, gnu-win32 AT cygnus DOT com
X-Unparseable-Date: Tue, 19 Jan 1999 10:06:00 100

On 18 Jan 99, at 13:34, Suhaib M. Siddiqi wrote:

> Has anyone any suggestions why G77 (EGCS-1.1.1) gives undefined
> refernece to fork_.  I get same problem on RedHat Linux 5.2 with
> EGCS-1.1.1 and Cygnus-B20 with EGCS-1.1.1.
> 
> gridu.f: undefined reference to `fork_'
> collect2: ld returned 1 exit status.
> 

This a common feature of interfacing C and fortran call 
fortrand by default append a decorating _ (as mangling) for the linker stage.
while C do not.

There is two solution either your fortran compiler has an option to generates 
C style function name. it is not supported by all compiler and I am not sure 
for g77

either you create a warping function in C wich is fork_  and call fork 
By the way to don't get confuse afterward you d rather call your function with 
a prefix so it do not look too simalar to the C function  in fortran and C code 
like fc_fork_   or whatever.


//////////////////////////////////////////////////
//
// Stephane Cateland <cateland AT adersa DOT asso DOT fr>
//
//   Adersa  10 rue de la croix Martre   
//   91873 Palaiseau cedex    FRANCE
//
//   Phone   [switchboard]   (33) 0 160 135 353
//   Fax                     (33) 0 169 200 563 
//
//////////////////////////////////////////////////
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019