Mail Archives: djgpp/2003/11/20/11:37:15
> From: Thomas8675309 AT yahoo DOT com (Tom)
> Newsgroups: comp.os.msdos.djgpp
> Date: 20 Nov 2003 07:08:54 -0800
> >
> > Since exsprite.c has a `.c' extension, it's probably a C program, not
> > a C++ program. So why did you use gpp to compile it? Please try
> > using gcc instead, and see if that helps.
>
> This demonstrates a difference between gxx and gpp that I was not
> previously aware of. gxx, like gcc, uses the file's extension to
> decide whether to use the C compiler or C++ compiler. In contrast,
> gpp apparently ignores the file's extension and compiles it using the
> C++ compiler.
I think this is true.
> Both gxx and gpp automatically link in the C++ standard library, while
> gcc does not.
Right. In fact, the _only_ situation where gxx/gpp are really useful
is when you _link_ C++ programs. To _compile_ C++ programs, gcc is
sufficient.
Personally, I always use gcc when compiling sources into object files.
> Are there other differences in expected behavior between gpp and gxx?
They are two different programs, so you should expect them to behave
in slightly different ways. Functionally, they are equivalent,
i.e. they attempt to do the same job, but when they bump into abnormal
situations, they react differently.
- Raw text -