I have an extremely small project in visual studio 2012 (only 50 lines of code). I only have one source file (main.cpp
). But yet it takes about 20 seconds or more to compile! How am I supposed to speed it up? When I use C# the compile times are fast but when it comes to C++ it's super slow.
As for my minimal computer specs, I have an i5 processor, 4gb of ram and it is a quad core. It shouldn't be taking this long to compile something that is only 50 lines long. What should I do?
My Code:
#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;
}