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

C++StdStdvector

C++ Problem Overview


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

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

C++ Solutions


Solution 1 - C++

You should include the vector header:

#include <vector>

Solution 2 - C++

#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 <set> does the trick.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionOtagoHarbourView Question on Stackoverflow
Solution 1 - C++taocpView Answer on Stackoverflow
Solution 2 - C++leandro souza rosaView Answer on Stackoverflow