#include <vector>

Ok this one has me a bit confused. I'm trying to compile a .h file by itself

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef SOLVER_H_
#define SOLVER_H_

#include <map>
#include <vector>
template<class cType>
class Solver
{
public:
	std::vector<int> evaluate(vector<int> initialData);//line 25
private:
	std::map<int,int> seenConfigs;
};
#endif //SOLVER_H_


To me this is syntactically correct. but the compiler says:

Solver.h:25: error: `vector' has not been declared
Solver.h:25: error: expected `,' or `...' before '<' token
Solver.h:25: error: ISO C++ forbids declaration of `parameter' with no type


So apparently I'm wrong about that being correct. Any idea why this isn't working?
you forgot the std:: on the second instance of vector

barely beat ya =]
Last edited on
std::vector<int> evaluate(std::vector<int> initialData);
Last edited on
bingo. Thanks.
Topic archived. No new replies allowed.