This problem has caused me hours of getting nothing done over the last 2 days...
If i make my own class and include a library in the .cpp, I keep getting ONE of these errors:
'vector' not a member of std;
'string' not a member of std;
in my .cpp file i have #include <vector> and #include <string>
i do NOT use "using namespace std;"
std::string x;
is now working, when it would not work for my earlier class.
and yet
std::vector<int> my_vector;
gives me the vector error.
I can't figure out where it is going wrong. Sometimes it throws one error, and at times it throws the other. The code for the 2 classes is identical.
This is all very confusing... so here is the code that is throwing the vector error and NOT the string error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#ifndef PLAYER_H
#define PLAYER_H
class Player
{
public:
Player();
~Player();
private:
std::string name;
std::vector<Card> hand1;
};
|
1 2 3 4 5 6 7 8 9 10 11
|
#include "Player.h"
#include "Card.h"
#include <string>
#include <vector>
#include <iostream>
Player::Player(){}
Player::~Player(){}
|