question about compiling with g++ 3.1 version
Oliver Kullmann
O.Kullmann@swansea.ac.uk
Mon May 20 09:31:00 GMT 2002
> Dear gcc users,
>
> I tried to compile one program that is compilable with g++ 2.95.3
> version..
>
> The is problem with these lines:
>
> class VectorMultiset {
> typedef vector< multiset<unsigned long>* >::iterator VSI;
> typedef vector< multiset<unsigned long>* >::const_iterator CVSI;
> ....
>
> I got error message:
>
> In file included from vertices.h:6,
> from coalescent.h:13,
> from Coalescent7.cc:5:
> vectormultiset.h:13: ISO C++ forbids declaration of `vector' with no type
> vectormultiset.h:13: template-id `vector<std::multiset<long unsigned int,
> std::less<long unsigned int>, std::allocator<long unsigned int> >*>'
> used as
> a declarator
> vectormultiset.h:13: parse error before `::' token
> vectormultiset.h:14: non-template type `vector' used as a template
> vectormultiset.h:14: ISO C++ forbids declaration of `const_iterator' with
> no
> type
> vectormultiset.h:14: confused by earlier errors, bailing out
> Exit 1
>
> How I can do vector< multiset<unsigned long>* > in g++ 3.1 version?
>
> Janos
Hi,
the problem just is that you have to use "std::vector" instead of "vector"
(or use a using declaration "using std::vector;").
The standard library lives in namespace "std" (but g++ 2.95.3 wasn't aware of that).
Oliver
More information about the Gcc-help
mailing list