Main file don't sees incuded header in stdafx.h
Main file don't sees incuded header in stdafx.h
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
How's your main code?
– heuristican
14 hours ago
It's means file with main function, I added link to repository
– Sergiusz Kaźmierczak
14 hours ago
Problem solved btw
– Sergiusz Kaźmierczak
14 hours ago
1 Answer
1
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.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
github.com/serkaz97/IROBOTGAME repository with project
– Sergiusz Kaźmierczak
14 hours ago