Newsgroups: comp.os.msdos.djgpp From: "Alexey Kouzmitch" 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 Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary="----=_NextPart_000_01BC3C76.51F13120" 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 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 > 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

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?
> = ------------------------------------------------------------------------<= br>> mailto:deltaman AT swipnet DOT se
>
> Please visit my homepage at http://www.geocities.com/TimesSquare/8240
> = ------------------------------------------------------------------------<= br>> ______  _______ =        _______ _______ _______ = _______ __   _
>  |     \ = |______ |         | =    |_____| |  |  | |_____| | \  |
> =  |_____/ |______ |_____    |    | =     | |  |  | |     | = |  \_|
>
>

------=_NextPart_000_01BC3C76.51F13120--