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
Vectors in C++C++ has a vector class within the std namespace. A vector is similar to an array, in a sense where a series of elements are stored with the same variable name. Unlike arrays, vectors are dynamically sized, which is a major advantage.
The reason the compiler says “vector is not a type” is that vector is not a type. It's a template from which types can be made.
Appending to a vector means adding one or more elements at the back of the vector. The C++ vector has member functions. The member functions that can be used for appending are: push_back(), insert() and emplace(). The official function to be used to append is push_back().
You should include the vector
header:
#include <vector>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With