[GRASSLIST:841] Re: programming in C++ or C?

Glynn Clements glynn.clements at virgin.net
Mon Jul 28 05:17:42 EDT 2003


Massimiliano Cannata wrote:

> I'm starting to develoop a set of command that
> will be aggregate to have a distributed
> hydrological model.
> I'm now consider to write them in C++ instead of
> C.
> Can I do that in Grass? Just changing in the
> makefile the compiler?
> There is some region why not to use C++?

The released versions of GRASS don't support compiling C++ code.

There are experimental changes in the CVS version to allow for C++,
but they suffer from a number of flaws, the most significant being
that all configure checks are done using C. If your C++ compiler needs
different switches, it won't work. IOW, if you use gcc for both C and
C++, it will probably work, otherwise it won't.

Also, C++ is still less portable (both as source code and compiled
binaries, particularly the latter) and less well supported than C. Not
everyone uses Linux and gcc; it's not uncommon for systems running a
commercial Unix variant not to have a C++ compiler, or to only have an
old (and quite possibly buggy) C++ compiler, or to have very poor
system support (linker, libraries, debugger etc) for C++.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list