命名空间'std'中的'vector'没有命名类型

时间:2013-06-01 01:39:16

标签: c++ std stdvector

我正在使用Debian 7.0.0上的CodeBlocks 10.05开发一个C ++应用程序。

出于某种原因,以下代码

#include <iostream>

std::vector< int > delaunayDiv(const std::vector< int <T> > & vP, cv::Rect boundRect,
    std::vector<int>& triangles, int& numTriangles, bool lookRight);

返回以下错误

error: 'vector' in namespace 'std' does not name a type

2 个答案:

答案 0 :(得分:121)

您应该包含vector标题:

#include <vector>

答案 1 :(得分:-5)

当我使用Clang时,

#include <vector>不起作用,我不知道它是否与C ++版本或库有区别。

#include <set>可以解决问题。