TNT 0.82 examples don't compile!
Phil Austin
phil@geog.ubc.ca
Fri Jun 26 14:04:00 GMT 1998
>>>>> "Thomas" == Thomas Kunert <kunert@physik.tu-dresden.de> writes:
Thomas> Prabhu Ramachandran wrote:
>> Hi! I just obtained the TNT (Template Numerical Toolkit)
>> version 0.8.2 I didn't try the 0.9 version because it needed
>> namespaces. When I compiled one of the example programs with
>> gcc-2.7.2.3 it worked fine but when I used the egcs-1.0.3a
>> release. I got the following errors. I tried to compile it with
>> the -fguiding-decls but it failed then as well. I would like to
>> know if this is a bug and what can I do about it. TNT is
>> available at http://math.nist.gov/tnt
>>
Thomas> Two bugs are in TNT: The 'typename' keyword is missing and
Thomas> the wrong (old) syntax for declaring friend template
Thomas> functions is used. These things can be fixed easily. In
Thomas> fact, I have done this some weeks ago but deleted in the
Thomas> meantime, because TNT didn't meet my needs :(.
Here are patches against TNT 0.85:
To: pozo@nist.gov
Subject: patches for TNT 0.85 for egcs 1.0 and KCC
Hi, I'm enclosing patches for vec.h and cmat.h that remove a problem
with improperly declared templated friend functions (according to
egcs-1.00 and (presumably gcc-2.8.0). KAI C++ 3.2d doesn't yet
support the <> in front of the function name, hence the FT macro hack.
I'm also enclosing the mailing that alerted me to the problem.
I also had undef region2d.h to get a compile with egcs-1.0. The
error message is:
<phil@peacock: tnt.dir/0.85> g++ -g -I. cvec.cc
In file included from cmat.h:24,
from cvec.cc:5:
region2d.h:37: `Array2D::value_type' is not a valid declarator
region2d.h:37: perhaps you want `typename Array2D::value_type' to make it a type
_______________________________________________________________
<phil@peacock: tnt.dir/0.85> diff vec.h vec_orig.h
17,23d16
< #ifdef __KCC
< # define FT
< #else
< # define FT <>
< #endif
<
<
31,35d23
< template <class T> class Vector;
<
< template <class T> istream& operator>>(istream &s, Vector<T> &A);
<
<
279c267
< friend istream& operator>> FT (istream &s, Vector<T> &A);
---
> friend istream& operator>>(istream &s, Vector<T> &A);
______________________________________________________
<phil@peacock: tnt.dir/0.85> diff cmat.h cmat_orig.h
23d22
< #undef TNT_USE_REGIONS
28,32d26
< template <class T> class C_matrix;
<
< template <class T> istream& operator>>(istream &s, C_matrix<T> &A);
<
<
330c324
< friend istream& operator>> FT (istream &s, C_matrix<T> &A);
---
> friend istream& operator>>(istream &s, C_matrix<T> &A);
_________________________________________________
More information about the Gcc-bugs
mailing list