[Dev-C++] "no class template named " error
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Gary R. <ga...@fi...> - 2003-08-12 17:20:57
|
> Message: 9
> From: "Hossein Haeri" <ult...@em...>
> To: dev...@li...
> Date: Mon, 11 Aug 2003 12:30:08 -0500
> Subject: Re: [Dev-C++] Compiler error
>
> Dear Gary,
>
> > I'm trying to compile some code that was originally developed under MSVS
6.0
> > and includes some C++ code that was written by someone else. The error
I'm
> > getting occurs in an include file and is: "no class template named". A
> > portion of the code involved is shown below. The compiler flags the line
> > containing the first opening brace. What could I do to correct this?
>
> My first suspection is that you are probabely getting that error because
of
> the following name:
>
> random_access_iterator_parent, that is here:
>
> > class iterator
> > : public random_access_iterator_parent(seqref<T>)
>
> It is not a portable name. (I know it's probabely a template!) If you are
> using a newer version of MSVC, it is likely that this new version doesn't
use
> that name as the parent of its iterators of type RandomAccess. Cehck it!
And
> if you are now trying to compile the code under a completely different C++
> implementation, say BCB or GCC, the error should be obvious knowing the
> portablity problem. To fix it, try to find the base type your current
> implemetation uses to implement RandomAccess iterators. Having that done,
if
> the code you'r trying to compile doesn't contain other VC-dependant stuff,
it
> should compile.
>
> Another suspection is to the name: seqref<>. Are you sure that it is in an
> OK state? Is it declared/defined? ...
>
> And the last one: It seems to that the following code
>
> > : public random_access_iterator_parent(seqref<T>)
>
> should be replace by either
>
> > : public random_access_iterator_parent(seqref<T>())
>
> or
>
> > : public random_access_iterator_parent<seqref<T> > //The space is
needed
>
> Regards,
> --Hossein
> --
> __________________________________________________________
Hossein,
Thanks for your reply. My apologies for providing such a cryptic description
of my problem and also for the misleading subject; I didn't mean to imply
that I thought the compiler was at fault.
I'm using Dev-C++ 4.9.8.0. A search on Google turned up a
number of references to this error but no solutions as far as I could tell.
I tried your suggestions of placing "()" or a blank after the code fragment
seqref<T> but that didn't change anything. My knowledge of C++ is minimal
and I don't know how to follow up on your suggestion regarding the
"name as the parent of its iterators of type RandomAccess". I checked the
on-line version of the GNU compiler manual but didn't find anything helpful.
Below I have included the output of the compiler log and a somewhat longer
fragment of the code. I hope this will provide a few more clues to you or
some other kind C++ guru.
Thanks,
Gary Richardson
----------------------------------------------------------------------------
Compiler: Default compiler
Building Makefile: "C:\My Documents\CPP\CXX\afftw_\Makefile.win"
Executing make...
make.exe -f "C:\My Documents\CPP\CXX\afftw_\Makefile.win" afftw.o
g++.exe -c afftw.cxx -o
fftw.o -I"C:/DEV-CPP/include/c++" -I"C:/DEV-CPP/include/c++/mingw32" -I"C:
/DEV-CPP/include/c++/backward" -I"C:/DEV-CPP/include" -I"c:/Python22/inclu
de" -I"C:/PyCXX-V5.1-rc2" -D__GNUWIN32__ -W -DWIN32 -DNDEBUG -D_WINDOWS -DH
AVE_WIN32 -DUSE_FFTW_DLL -ansi -w
In file included from afftw.cxx:11:
C:/PyCXX-V5.1-rc2/CXX/Objects.hxx:1135: no class template named `
random_access_iterator' in `std'
C:/PyCXX-V5.1-rc2/CXX/Objects.hxx:1271: no class template named `
random_access_iterator' in `std'
Execution terminated
----------------------------------------------------------------------------
namespace Py
{
// Forward declarations
class Object;
template<class T> class SeqBase;
...
template<class T>
class SeqBase: public Object
{
typedef seqref<T> reference;
typedef seqref<T>* pointer;
...
class iterator
: public random_access_iterator_parent(seqref<T>)
{ <<<<<<<<<< Error detected here
protected:
friend class SeqBase<T>;
SeqBase<T>* seq;
int count;
public:
~iterator ()
{}
iterator ()
{
seq = 0;
count = 0;
}
...
}; // end of class SeqBase<T>::iterator
class const_iterator
: public random_access_iterator_parent(const Object)
{ <<<<<<<<<< Error detected here
protected:
friend class SeqBase<T>;
const SeqBase<T>* seq;
sequence_index_type count;
~const_iterator ()
{}
const_iterator ()
{
seq = 0;
count = 0;
}
...
}; // end of class SeqBase<T>::const_iterator
...
|