"... is not a template"和"expected initializer before '<'"错误
"... is not a template" and "expected initializer before '<'" errors
我试图编译Nurbs++库的一部分,但遇到了一堆错误,如下所示。为什么?
nurbs_pp/matrix/source/vector.cpp:49:20: error: ‘Vector’ is not a template
nurbs_pp/matrix/source/vector.cpp:49:37: error: expected initializer before ‘<’ token
在vector.h中:
namespace PLib {
template <class T> class Vector ;
template<class T> class Vector : public BasicArray<T>
{
public:
int rows() const //!< a reference to the size of the vector
{ return this->sze ;}
Vector() : BasicArray<T>(1) {} //!< Basic constructor
Vector(const int r) : BasicArray<T>(r) {}
Vector(const Vector<T>& v) : BasicArray<T>(v) {}
Vector(const BasicArray<T>& v) : BasicArray<T>(v) {}
Vector(T* ap, const int size) : BasicArray<T>(ap,size) {}
Vector(BasicList<T>& list) : BasicArray<T>(list) {}
virtual ~Vector() {}
Vector<T>& operator=(const Vector<T>& v);
Vector<T>& operator=(const BasicArray<T>& b);
矢量.cpp:
namespace PLib {
template <class T> Vector<T>& Vector<T>::operator=(const Vector<T> &b)
问题最终出现在建筑中。有两个名为vector.h的文件,qmake不喜欢这样。
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- QT在错误的班级中寻找空位
- vector.resize()中的分配错误
- 错误:调用"std::vector<:vector<int>>::p ush_back(std::vector<std::__cxx11::basic_string<
- 错误,包括&lt; ctype&gt;在原子上使用C 11
- &lt;&lt;操作员在C 中超载错误
- opencv 2.4.7在iOS错误背景_segm.hpp #include&lt; list&gt;未找到
- '&lt;'''&lt;'''&quot的模板类错误''令牌”
- 在尝试超载&lt;&lt;时链接错误2005和1169操作员
- 错误:没有匹配'运算符<<"在'std::cout
- 过载<<比如cout错误
- 重载& lt; & lt;为什么我得到以下错误
- 重载ostream&时转换错误无效;operator< & lt;
- 重载<<运算符错误C2804:二进制'运算符<<'参数太多
- 编译器错误,包括'<'代币
- 重载& lt; & lt;错误