[GRASS5] Re: updated r.terraflow compile error

> > the updated r.terraflow causes the automated Linux compilation
> > of 5.7 to fail:
> >
> [...]
> >
> > It is a Redhat 7 system (grass.itc.it) - on my Mandrake 9.1 box
> > it compiles well. Do you have an idea?
> >
> > A quick locate tells me
> > /usr/include/c++/3.2.2/ostream
> >
> > Seems that r.terraflow is no longer compliant with gcc <= 3.2.2?

Apparently so.

> I've got a RH 7.3 computer I can test it on, and both gcc 2.96 & 3.3 on
> my debian one. I'll see what I can figure out.

Thanks. Here a locate on 'grass.itc.it'

/usr/include/php/Zend/zend_istdiostream.h
/usr/include/g++-3/iostream
/usr/include/g++-3/iostream.h
/usr/include/g++-3/ostream.h

                     ^^^^^^^^^ and there's the problem.

gcc 2.96 (g++) includes both a current and backwards compatible version
of iostream (and others), but it doesn't include a current "ostream".

So there's only ostream.h on gcc 2.96, and the compile fails. I guess we
are stuck with setting it to <ostream.h> and seeing "depreciated" messages.

fyi Debian/testing with gcc 2.96, 3.2, and 3.3 has these:
/usr/include/g++-3/iostream.h
/usr/include/g++-3/iostream
/usr/include/g++-3/ostream.h

/usr/include/c++/3.2/backward/iostream.h
/usr/include/c++/3.2/backward/ostream.h
/usr/include/c++/3.2/iostream
/usr/include/c++/3.2/ostream

/usr/include/c++/3.3/backward/iostream.h
/usr/include/c++/3.3/backward/ostream.h
/usr/include/c++/3.3/iostream
/usr/include/c++/3.3/ostream

/usr/include/g++-3/stdiostream.h
/usr/include/g++-2/iostream
/usr/include/g++-2/iostream.h
/usr/include/g++-2/ostream.h
/usr/include/g++-2/stdiostream.h
/usr/include/aspell/app_ostream.hh
bash-2.04$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.1)

If it is easier, I could also upgrade the compiler on that machine
(but what about compatibility then?).

Better to make the code work for gcc 2.96, which is pretty standard.

It'll probably break for older versions of the compiler though, what
can one do? I'd rather not have "#ifdef GCC_3.3"s everywhere..

regards,
Hamish

There should be a variable that tells the gcc version. Anybody knows how it's called? I could add something like
#if version < 3.2.2
#include <ostream.h>
#else
#include <ostream>

On Tuesday, January 20, 2004, at 05:22 AM, Hamish wrote:

the updated r.terraflow causes the automated Linux compilation
of 5.7 to fail:

[...]

It is a Redhat 7 system (grass.itc.it) - on my Mandrake 9.1 box
it compiles well. Do you have an idea?

A quick locate tells me
/usr/include/c++/3.2.2/ostream

Seems that r.terraflow is no longer compliant with gcc <= 3.2.2?

Apparently so.

I've got a RH 7.3 computer I can test it on, and both gcc 2.96 & 3.3 on
my debian one. I'll see what I can figure out.

Thanks. Here a locate on 'grass.itc.it'

/usr/include/php/Zend/zend_istdiostream.h
/usr/include/g++-3/iostream
/usr/include/g++-3/iostream.h
/usr/include/g++-3/ostream.h

                     ^^^^^^^^^ and there's the problem.

gcc 2.96 (g++) includes both a current and backwards compatible version
of iostream (and others), but it doesn't include a current "ostream".

So there's only ostream.h on gcc 2.96, and the compile fails. I guess we
are stuck with setting it to <ostream.h> and seeing "depreciated" messages.

fyi Debian/testing with gcc 2.96, 3.2, and 3.3 has these:
/usr/include/g++-3/iostream.h
/usr/include/g++-3/iostream
/usr/include/g++-3/ostream.h

/usr/include/c++/3.2/backward/iostream.h
/usr/include/c++/3.2/backward/ostream.h
/usr/include/c++/3.2/iostream
/usr/include/c++/3.2/ostream

/usr/include/c++/3.3/backward/iostream.h
/usr/include/c++/3.3/backward/ostream.h
/usr/include/c++/3.3/iostream
/usr/include/c++/3.3/ostream

/usr/include/g++-3/stdiostream.h
/usr/include/g++-2/iostream
/usr/include/g++-2/iostream.h
/usr/include/g++-2/ostream.h
/usr/include/g++-2/stdiostream.h
/usr/include/aspell/app_ostream.hh
bash-2.04$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.1)

If it is easier, I could also upgrade the compiler on that machine
(but what about compatibility then?).

Better to make the code work for gcc 2.96, which is pretty standard.

It'll probably break for older versions of the compiler though, what
can one do? I'd rather not have "#ifdef GCC_3.3"s everywhere..

regards,
Hamish

-Laura

There should be a variable that tells the gcc version. Anybody knows
how it's called? I could add something like
#if version < 3.2.2
#include <ostream.h>
#else
#include <ostream>

Yes, but what about compiling on a something that isn't gcc?

Anyone know what Solaris/SGI/Cygwin/MacOSX has?

?,
Hamish

>>>> the updated r.terraflow causes the automated Linux compilation
>>>> of 5.7 to fail:

...

>> /usr/include/g++-3/iostream
>> /usr/include/g++-3/iostream.h
>> /usr/include/g++-3/ostream.h
>
> ^^^^^^^^^ and there's the problem.
>
> gcc 2.96 (g++) includes both a current and backwards compatible version
> of iostream (and others), but it doesn't include a current "ostream".
>
> So there's only ostream.h on gcc 2.96, and the compile fails. I guess
> we are stuck with setting it to <ostream.h> and seeing "depreciated"
> messages.

On Jan 20, 2004, at 6:00 PM, Hamish wrote:

There should be a variable that tells the gcc version. Anybody knows
how it's called? I could add something like
#if version < 3.2.2
#include <ostream.h>
#else
#include <ostream>

Yes, but what about compiling on a something that isn't gcc?

Anyone know what Solaris/SGI/Cygwin/MacOSX has?

OSX is gcc; version 3.1 or 3.3 depending on which version of the development tools you have installed.

Chris

--
Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g )
Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia

On Wed, 21 Jan 2004, Hamish wrote:

> There should be a variable that tells the gcc version. Anybody knows
> how it's called? I could add something like
> #if version < 3.2.2
> #include <ostream.h>
> #else
> #include <ostream>

Yes, but what about compiling on a something that isn't gcc?

Anyone know what Solaris/SGI/Cygwin/MacOSX has?

I thought it only compiled with g++ anyway:

http://grass.itc.it/pipermail/grass5/2003-March/007342.html