I am compiling a source code library that works flawlessly with Visual Studio 2008 (VC90), Visual Studio 2010 RCand gcc under Linux, but fails when compiled with any recent version of Intel's C++ compiler (11.1, 12.0.0.016). I get "error: incomplete type is not allowed" at the location shown below marked with << error: incomplete type is not allowed.
Is there a way to modify this to work with an Intel C++ compiler? Since Visaul Studio 2010 RC is a new compiler and compiles and runs this without error, is this a bug in the Intel C++ compiler?
class Vector3 : public Tuple<3,Real>
Vector3 (); // uninitialized
Vector3 (const Vector3& vec);
................ class declaration stuff edited ....................
void GetBarycentrics (const Vector3& v0, const Vector3& v1, const Vector3& v2, const Vector3& v3, Real bary) const;
// The intrinsic dimension of the input set. The parameter 'epsilon'
// to the GetInformation function is used to provide a tolerance when
// determining the dimension.
// Axis-aligned bounding box of the input set. The maximum range is
// the larger of max-min, max-min, and max-min.
Real mMin, mMax;
// Coordinate system. The origin is valid for any dimension d. The
// unit-length direction vector is valid only for 0 <= i < d. The
// extreme index is relative to the array of input points, and is also
// valid only for 0 <= i < d. If d = 0, all points are effectively
// the same, but the use of an epsilon may lead to an extreme index
// that is not zero. If d = 1, all points effectively lie on a line
// segment. If d = 2, all points effectively line on a plane. If
// d = 3, the points are not coplanar.
>> Vector3 mDirection; << error: incomplete type is not allowed
// The indices that define the maximum dimensional extents. The
// values mExtreme and mExtreme are the indices for the points
// that define the largest extent in one of the coordinate axis
// directions. If the dimension is 2, then mExtreme is the index
// for the point that generates the largest extent in the direction
// perpendicular to the line through the points corresponding to
// mExtreme and mExtreme. Furthermore, if the dimension is 3,
// then mExtreme is the index for the point that generates the
// largest extent in the direction perpendicular to the triangle
// defined by the other extreme points. The tetrahedron formed by the
// points V[extreme0], V[extreme1], V[extreme2], V[extreme3]> is
// clockwise or counterclockwise, the condition stored in mExtremeCCW.
// The value of epsilon is used as a relative error when computing the
// dimension of the point set.
static void GetInformation (int numPoints, const Vector3* points,
Real epsilon, Information& info);
// Special vectors.
static const Vector3 ZERO; // (0,0,0)
static const Vector3 UNIT_X; // (1,0,0)
static const Vector3 UNIT_Y; // (0,1,0)
static const Vector3 UNIT_Z; // (0,0,1)
static const Vector3 ONE; // (1,1,1)
// Arithmetic operations.
// Debugging output.
std::ostream& operator<< (std::ostream& outFile, const Vector3
Belowis a small reproducer which compiles with cl and g++ but not icpc or icl. I have entered this is in
our bug tracking database as cq #153823. thanks for reporting it, we will fix it ASAP.
Vector3 mOrigin; // compiles without error
Vector3 mDirection; // error: incomplete type is not allowed
The only workaround I can think of is to move the declaration of the nested class Information outside the Vector3 class, i.e.:
The otherpossible woraroundis instead of declaring an array for mDirection you declare a pointer which you would then need to dynamically allocate and deallocate as needed.