delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/27/13:23:53

From: broeker AT physik DOT rwth-aachen DOT de
Newsgroups: comp.os.msdos.djgpp
Subject: Re: library headaches
Date: 27 Mar 2000 13:38:08 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 36
Message-ID: <8bno80$fi0$1@nets3.rz.RWTH-Aachen.DE>
References: <diDC4.218160$B6 DOT 1555612 AT quark DOT idirect DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 954164288 15936 137.226.32.75 (27 Mar 2000 13:38:08 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 27 Mar 2000 13:38:08 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tony Kwan <kwantk AT idirect DOT com> wrote:
> I am trying to make my first multi-file project with RHIDE but the compiler
> is giving me errors which I don't know how to fix.  Essentially I am
> following a tutorial I got from the net on "C Libraries and Makefiles" from
> DevCentral:  (abbreviated)

[I wonder how you thought you'ld learn RHIDE from a tutorial dealing
with Makefiles... it's the opposite of using Makefiles, essentially.]

Anyway, your examples contains two minor faults, and a fatal usage
error of RHIDE:

> int rand()  {...}

Don't name your functions like ones already defined in the Standard C
Library, if you can help it.

> void main()

main() *has* to return an int. Everything else is an error.

> Error Message:
> ----------------------------------
>  Error: util.o: In function `rand':
>  util.c(6) Error: multiple definition of `rand'
>  o:util.c(6) Error: first defined here

You've added the file 'util.o' to the RHIDE project file list. That's
your actual error. Only the .c files should go there.




-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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