C++ 命名空间“std”中的“vector”未命名类型

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16868230/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 20:43:28  来源:igfitidea点击:

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

c++stdstdvector

提问by OtagoHarbour

I am developing a C++ application using CodeBlocks 10.05 on Debian 7.0.0.

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

For some reason, the following code

出于某种原因,以下代码

#include <iostream>

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

returns the following error

返回以下错误

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

回答by taocp

You should include the vectorheader:

您应该包括vector标题:

#include <vector>

回答by leandro souza rosa

#include <vector>does not worked when I use Clang, I do not really know if it is a difference in C++ versions or libraries.

#include <vector>当我使用 Clang 时不起作用,我真的不知道这是否是 C++ 版本或库的差异。

#include <set>does the trick.

#include <set>诀窍。