ERROR C2039: 'vector': is not a member of 'std'

std::vector<Item> items = std::vector<Item>(); declares a complete type.

Therefore the compiler needs to know the declaration of std::vector at that point (amongst other things, it's required to establish the compile-time evaluable constant sizeof Hero). The solution is to #include <vector> in the header hero.h, not the source file.


Include <vector> in your Hero.h header and consider removing it from your Hero.cpp file as mentioned in the comments below.