From: Martin Ambuhl Newsgroups: comp.os.msdos.djgpp,alt.comp.lang.learn.c-c++ Subject: Re: Problem implementing multiple moduled program Date: Wed, 27 Jan 1999 16:55:07 -0500 Content-Transfer-Encoding: 7bit References: <36b41be7 DOT 2525182 AT news> <36AE2EF6 DOT 3AC3 AT seidata DOT com> <36b05fef DOT 19943524 AT news> X-Posted-Path-Was: not-for-mail X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: 27 Jan 1999 21:55:12 GMT X-ELN-Insert-Date: Wed Jan 27 14:05:01 1999 Organization: Nocturnal Aviation Lines: 32 Mime-Version: 1.0 NNTP-Posting-Host: 1cust156.tnt12.nyc3.da.uu.net Message-ID: <36AF8B3B.6FA1C941@earthlink.net> X-Mailer: Mozilla 4.5 [en] (Win95; I) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Stuart Hall wrote: > > On Tue, 26 Jan 1999 13:09:10 -0800, Marvin G Wise Jr > so kindly spent valuable time writing: > > > > >Well, if this is the function prototype in your header file then it > >should have a semicolon at the end... > > > > char *getsafe(char *buffer, int count); > > > > Ok, I tried this, and got a few more errors. Now my program looks > like this, both modules compile just fine -- but when the linker gets > to them it gives me an error: > > creating multiple.exe: > Error: getsafe.o: In function 'getsafe': > getsafe.c(8): Error multiple definition of 'getsafe' > 0:getsafe.c(8): Error first defined here. I cannot reproduce your diagnostic. The code you posted should be fine except that 1) main.c needs to #include 2) the final line (actually every line) should be terminated with a '\n'. -- Martin Ambuhl (mambuhl AT earthlink DOT net) Note: mambuhl AT tiac DOT net will soon be inactive