78

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
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
OtagoHarbour
  • 3,969
  • 6
  • 43
  • 81

2 Answers2

167

You should include the vector header:

#include <vector>
Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
taocp
  • 23,276
  • 10
  • 49
  • 62
0

#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.

  • 2
    This does not provide an answer to the question. Once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/15537456) – user2314737 Mar 15 '17 at 20:21
  • 1
    sorry I forgot the to mark the code as code and the answer made no sense. Edited to correct it – leandro souza rosa Mar 15 '17 at 21:40