Hello everyone!
I'm trying to write a programm which simulates a football championship. I'm using Microsoft Visual Studio 2008. I just have started but there is a mistake already which doesn't allow me to continue and i have no idea what it is.
Here is my header file, where the mistake has been found:
1 2 3 4 5 6 7 8 9
#pragma once
class Football_league {
vector <Football_Club> League;
public:
Football_league(vector<Football_Club>);
~Football_league(void);
};
the mistake is found in this line "vector <Football_Club> League;" and the compiler says:error C2143: syntax error : missing ';' before '<'. what the heck is that?
Oh, there it is.
You're including your headers in stdafx.h before including <vector>.
It's a bad idea to include your own headers in stdafx.h. Every time you change them, the associated precompiled header will have to be recompiled. Precompiled headers were designed to speed up compilation by compiling long, rarely changed headers only once. What you're doing negates this.