-1

Hey I have strange problem... When I'm adding a class into my project in VS 2015 Im including new class into stdafx.h, and stdafx I including to file with main function. When I compiling a program, VS throws Error:

I show it on the code: stdafx.h

#pragma once
#include  <time.h>

#include <map>
#include "targetver.h"
#include <math.h>
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <vector>
#include <deque>
#include <GL/freeglut.h>
#include "FreeImage.h"

#include "vec3.h"
#include "vec2.h"
#include "vec4.h"

#include "TextureManager.h"
#include "SceneObject.h"
#include "Obj3d.h"
#include "Door.h"
#include "Collider.h"
#include "TrashGen.h"

#include "Player.h"
#include "Scene.h"

Door.h:

class Door
{
public:
Door();
~Door();

int key;
};

Door.cpp:

#include "stdafx.h"
#include "Door.h"


Door::Door()
{
   key = 10;
} 


Door::~Door()
{
}

When i add in main function:

in this file I included stdafx.h

Door *dor;

i have an error:

Error C2065 'dor': undeclared identifier IROBOTGAME
Error C2065 'Door': undeclared identifier IROBOTGAME

1 Answers1

0

Sometimes, Visual C++ looses its way with the precompiled headers, depending on the sequence of your edits.
Simply do a full 'Rebuild', that might fix it.

Aganju
  • 6,295
  • 1
  • 12
  • 23