I am new to C++ and I am getting an odd error:
Error (active) PCH warning: an unknown error occurred. An IntelliSense PCH file was not generated. CPPAssessment Chamber.cpp 1
This is my Chamber.cpp:
#include "stdafx.h"
#include "Chamber.h"
Chamber::Chamber(std::string text) {
chamberDescription = text;
};
bool Chamber::hasHero() {
return false;
};
void Chamber::showChamberOptions() {
};
And this is my Chamber.h:
#include <vector>
#include "Enemy.h"
#include "Hero.h"
#pragma once
class Chamber {
public:
Chamber(std::string text);
bool north;
bool south;
bool east;
bool west;
int x;
int y;
std::vector<Enemy> enemies;
std::string chamberDescription;
bool hasHero();
void showChamberOptions();
private:
};
I can still run the program but everytime I go to this class in my IDE I get this error in the error list and we all hate errors of course!
Is there anything I can do to stop this? I read about adding pragma once but I already did that and I still receive the error.
Aucun commentaire:
Enregistrer un commentaire