MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.
g++ -c -O2 -DGCC coldet.cpp
In file included from coldet.cpp:25: coldetimpl.h: In member function `int CollisionModel3DImpl::getTriangleIndex(BoxedTriangle*)':
coldetimpl.h:76: error: no match for 'operator-' in 'bt - (((std::vector<BoxedTriangle, std::allocator<BoxedTriangle> >*)((CollisionModel3DImpl*)this)) + 4u)->std::vector<_Tp, _Alloc>::begin [with _Tp = BoxedTriangle, _Alloc = std::allocator<BoxedTriangle>]()'
math3d.h:174: note: candidates are: Vector3D operator-(const Vector3D&, const Vector3D&)
F:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_bvector.h:180: note: ptrdiff_t std::operator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)
In file included from coldet.cpp:26:
mytritri.h:96:21: warning: no newline at end of file
** error 1 ** deleting coldet.o
The first thing I tried was copying it's source to a \coldet sub directory under the source for my game, and include it's header, but then DevC++ (with it's MinGW compiler) returns the same error. I don't know a lot about C++ template classes (haven't needed them yet), but this code in the library seems to give the error:
Code: Select all
int getTriangleIndex(BoxedTriangle* bt)
{
return int(bt-m_Triangles.begin()); // <<<<
}
Code: Select all
int getTriangleIndex(BoxedTriangle* bt)
{
(std::vector<BoxedTriangle>::iterator)bt - m_Triangles.begin();
}