Mail Archives: djgpp/2000/03/07/18:53:12
On Mon, 6 Mar 2000, Rodeo Red wrote:
> This simple hello world program compiles fine but when I use -wall I get
> all the messages below.
You mean -Wall (Capital W), right?
> r.exe(.text+0x1ec):crt0.s: multiple definition of `__exit'
> c:/djgpp/lib/crt0.o(.text+0x1ec):crt0.s: first defined here
> r.exe(.text+0x2d0):crt0.s: multiple definition of `__sbrk'
> c:/djgpp/lib/crt0.o(.text+0x2d0):crt0.s: first defined here
>
> If these aren't warning messaes what are they ?
>
> I thought warning messages would say "warning" on them.
These messages are NOT warnings, they are errors. You didn't show the
exact command line you used to compile (you should *always* do that
when reporting compilation/link problems), but from the error messages
I'm guessing that you typed something like this:
gpp -o -wall r.exe 41.cpp
The problem is that the name of the program, r.exe, should
*immediately* follow the -o switch. The -o switch expects an
argument: the name of the file where to put the resulting program. If
you stick something between -o and the name of the program, the linker
will be confused.
In the above example, the program will be output to a file called
`-wall', and r.exe will be taken as one of the files which should be
linked into that program. That's why the linker complains: r.exe
already has the `main' function and all the other functions which come
from the startup module.
The correct command line is this:
gpp -Wall -o r.exe 41.cpp
> Is there any other way to turn on warning messages besides "- wall" ?
They are documented in the GCC manual, which see. From the command
line, type "info gcc invoking warning" and read there. (This assumes
you installed info.exe from txi40b.zip.)
> Is djgpp the same compiler they mean when they say "gcc" ?
DJGPP is the name of the project. GCC is the compiler used by DJGPP.
> Why does
> everyone else seem to use gcc as a command line but I have to use gpp ?
Use gcc for C programs, gpp for C++ programs. This is further
explained in the DJGPP FAQ list, section 8.8.
- Raw text -