Odd mistake while creating a class

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?

maybe the cpp file is needed:
1
2
3
4
5
6
7
8
9
10
11
#include "StdAfx.h"
#include "Football_league.h"

Football_league::Football_league(vector<Football_Club> UPL)
{
	League = UPL;
}

Football_league::~Football_league(void)
{
}

My code is absolutely simple as you can see.....
Probably the related class is needed... Here it is:
1
2
3
4
5
6
7
8
9
10
11
12
13
#pragma once

class Football_Club
{
	const string club_name;
    unsigned int points,goals_scored, goals_missed,rank;
	
public:
	Football_Club(string,unsigned int);
	~Football_Club(void);
	void printClubState()const;
};

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "StdAfx.h"
#include "Football_Club.h"

Football_Club::Football_Club(string nazv, unsigned int status ):club_name(nazv)
{
	
	points = 0;
	rank = status;
	goals_scored = 0;
	goals_missed = 0;
}

Football_Club::~Football_Club(void)
{
}
void Football_Club ::printClubState() const
{
	cout << club_name<<" "<<points<<" "<<goals_scored<<" "<< goals_missed;
}

And finally stdafx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>



// TODO: reference additional headers your program requires here
#include <iostream>
#include<conio.h>
using namespace::std;
#include<string>
#include "Football_Club.h"
#include "Football_league.h"
#include <vector> 

If someone can help me - thanks a lot in advance
using namespace std;, not using namespace::std;.
helios (8066)

It doesn't matter
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.
helios (8067)

You're absolutely right, buddy!!!! It works!!! That was obvious, I should have guessed myself!!! Thank you very much!!!
Topic archived. No new replies allowed.