ожидаемый конструктор, деструктор или преобразование типа перед '(' token

Компиляция polygone.h и polygone.cc дает ошибку:

polygone.cc:5:19: error: expected constructor, destructor, or type conversion before ‘(’ token

Код:

//polygone.h
# if !defined(__POLYGONE_H__)
# define __POLYGONE_H__

# include <iostream>

class Polygone {

    public:
        Polygone(){};
        Polygone(std::string fichier);

};

# endif

и

//polygone.cc
# include <iostream>
# include <fstream>
# include "polygone.h"

Polygone::Polygone(string nom)
{
    std::ifstream fichier (nom, ios::in);
    std::string line;

    if (fichier.is_open())
    {
        while ( fichier.good() )
        {
            getline (fichier, line);
            std::cout << line << std::endl;
        }
    }
    else
    {
        std::cerr << "Erreur a l'ouverture du fichier" << std::endl;
    }
}

//ifstream fich1 (argv[1], ios::in);

Я предполагаю, что компилятор не распознавая Polygone :: Polygone (string nom) как конструктор, но, если это действительно так, я не знаю почему.

Любая помощь?

12
задан Marconius 22 January 2012 в 00:42
поделиться