www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/29/21:55:37

Newsgroups: comp.os.msdos.djgpp
From: "Alexey Kouzmitch" <shinfain AT argo DOT net>
Subject: Re: Multiple-file problem
Sender: news AT homer DOT argo DOT net.
Message-ID: <01bc3ca0$3ac73920$33f0c6cd@shinfain.argo.net>
Date: Sun, 30 Mar 1997 00:14:05 GMT
References: <333C3C43 DOT 7216 AT geocities DOT com>
Nntp-Posting-Host: pm11.argo.net
Mime-Version: 1.0
Organization: AlJur Incorporated.
Lines: 89
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

This is a multi-part message in MIME format.

------=_NextPart_000_01BC3C76.51F13120
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

try making all the functions extern... That is something I was trying to do
too, but after some time abandoned, because it made it hard to debug!

-- 
Alexey Kouzmitch (the always right or wrong)

P.S.: But then again, maybe not!




Deltaman <deltaman AT geocities DOT com> wrote in article
<333C3C43 DOT 7216 AT geocities DOT com>...
> Hi!
> 
> My program have gotten reasonably big, so I decided to split it. I now
> have 'header.h' which contains the prototypes for all functions,
> 'mainprog.c' which contains void main() and some often updated functions
> and 'somefunc.c' which has some fundamental functions.
> 
> In 'somefunc.c' I include 'header.h' and 'mainprog.c' and in
> 'mainprog.c' I include 'header.h'. It compiles perfectly (in RHIDE) but
> when I links it I get the error messages:
> 
> mainprog.c(a number)    Error: multiple definition of <function>
> somefunc.c(same number) Error: first defined here
> 
> This happens with all functions (even main) in 'mainprog.c'. What should
> I do to make it work?
> ------------------------------------------------------------------------
> mailto:deltaman AT swipnet DOT se
> 
> Please visit my homepage at http://www.geocities.com/TimesSquare/8240
> ------------------------------------------------------------------------
> ______  _______        _______ _______ _______ _______ __   _
>  |     \ |______ |         |    |_____| |  |  | |_____| | \  |
>  |_____/ |______ |_____    |    |     | |  |  | |     | |  \_|
> 
> 
------=_NextPart_000_01BC3C76.51F13120
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 =
color=3D"#000000" face=3D"Arial">try making all the functions extern... =
That is something I was trying to do too, but after some time abandoned, =
because it made it hard to debug!<br><br>-- <br>Alexey Kouzmitch (the =
always right or wrong)<br><br>P.S.: But then again, maybe =
not!<br><br><br><br><br>Deltaman &lt;<font =
color=3D"#0000FF"><u>deltaman AT geocities DOT com</u><font =
color=3D"#000000">&gt; wrote in article &lt;<font =
color=3D"#0000FF"><u>333C3C43 DOT 7216 AT geocities DOT com</u><font =
color=3D"#000000">&gt;...<br>&gt; Hi!<br>&gt; <br>&gt; My program have =
gotten reasonably big, so I decided to split it. I now<br>&gt; have =
'header.h' which contains the prototypes for all functions,<br>&gt; =
'mainprog.c' which contains void main() and some often updated =
functions<br>&gt; and 'somefunc.c' which has some fundamental =
functions.<br>&gt; <br>&gt; In 'somefunc.c' I include 'header.h' and =
'mainprog.c' and in<br>&gt; 'mainprog.c' I include 'header.h'. It =
compiles perfectly (in RHIDE) but<br>&gt; when I links it I get the =
error messages:<br>&gt; <br>&gt; mainprog.c(a number) =
&nbsp;&nbsp;&nbsp;Error: multiple definition of &lt;function&gt;<br>&gt; =
somefunc.c(same number) Error: first defined here<br>&gt; <br>&gt; This =
happens with all functions (even main) in 'mainprog.c'. What =
should<br>&gt; I do to make it work?<br>&gt; =
------------------------------------------------------------------------<=
br>&gt; <font color=3D"#0000FF"><u>mailto:deltaman AT swipnet DOT se</u><font =
color=3D"#000000"><br>&gt; <br>&gt; Please visit my homepage at <font =
color=3D"#0000FF"><u>http://www.geocities.com/TimesSquare/8240</u><font =
color=3D"#000000"><br>&gt; =
------------------------------------------------------------------------<=
br>&gt; ______ &nbsp;_______ =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_______ _______ _______ =
_______ __ &nbsp;&nbsp;_<br>&gt; &nbsp;| &nbsp;&nbsp;&nbsp;&nbsp;\ =
|______ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| =
&nbsp;&nbsp;&nbsp;|_____| | &nbsp;| &nbsp;| |_____| | \ &nbsp;|<br>&gt; =
&nbsp;|_____/ |______ |_____ &nbsp;&nbsp;&nbsp;| &nbsp;&nbsp;&nbsp;| =
&nbsp;&nbsp;&nbsp;&nbsp;| | &nbsp;| &nbsp;| | &nbsp;&nbsp;&nbsp;&nbsp;| =
| &nbsp;\_|<br>&gt; <br>&gt; </p>
</font></font></font></font></font></font></font></font></font></body></h=
tml>
------=_NextPart_000_01BC3C76.51F13120--

- Raw text -


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