[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"conflicting declaration" of a typedef for std::vector
From: |
dave . rudolf |
Subject: |
"conflicting declaration" of a typedef for std::vector |
Date: |
Tue, 9 Dec 2008 11:05:21 -0800 (PST) |
User-agent: |
G2/1.0 |
Hi folks,
I have a very simple set-up that is giving me grief. In one header
file, I have the following types defined:
#include <vector>
struct Point {
int frameNum;
float x, y, z;
};
typedef std::vector< Point > Frame;
typedef std::vector< Frame > Capture;
Then, in another header, I want to use this type, but not actually
have to include the header (just for dependency simplification), so I
have
class Capture; // forward declaration
class Vector; // forward declaration
bool generateCentroid( const Capture& capture, int frameNumber,
Vector& posOut );
However, I get the following error when I do so:
points.h:14: error: conflicting declaration 'typedef class
std::vector<std::vector<Point, std::allocator<Point> >,
std::allocator<std::vector<Point, std::allocator<Point> > > > Capture'
pointutils.h:7: error: 'struct Capture' has a previous declaration as
'struct Capture'
I'm not sure exactly what it is complaining about, other than it maybe
doesn't like to match my forward declaration of Capture with the
typedef of a vector of a vector, or something like that. Can anyone
spot my mistake?
Thanks.
Dave
- "conflicting declaration" of a typedef for std::vector,
dave . rudolf <=