From: cateland@adersa.asso.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.C60EF81D@inspirepharm.com>
Reply-To: cateland@adersa.asso.fr
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
To: "Suhaib M. Siddiqi" <ssiddiqi@inspirepharm.com>, gnu-win32@cygnus.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@adersa.asso.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@cygnus.com" with one line of text: "help".
