Possible Duplicate:
Why does C++ compilation take so long?
Visual studio 2012 slow compile time
I'm using visual studio 2012 and the time it takes to compile is way to long. About 20 seconds just for a measly 50 lines of code. I thought it was my computers fault but c# compiles fine on it just not c++. I know that c++ takes longer to compile but 20 seconds is ridiculous.
Here's the code I'm trying to compile which takes about 20 seconds to compile.
#include<iostream>
using namespace std;
class Entity
{
protected:
int health;
public:
void SetHealth(int value)
{
health = value;
}
void DisplayHealth()
{
cout << "Entity: " << health << endl;
}
};
class Player : public Entity
{
private:
int xp;
public:
void DisplayHealth()
{
cout << "Player: " << health << endl;
}
};
class Enemy : public Entity
{
};
int main()
{
Player player;
Entity *entity = &player;
entity->SetHealth(10);
player.DisplayHealth();
system("pause");
return 0;
}