This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: question about compiling with g++ 3.1 version
- From: Oliver Kullmann <O dot Kullmann at swansea dot ac dot uk>
- To: Janos Murvai <murvai at ncbi dot nlm dot nih dot gov>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 20 May 2002 17:27:56 +0100
- Subject: Re: question about compiling with g++ 3.1 version
- References: <Pine.GSO.4.44.0205200913010.16151-100000@serpens>
> 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