我有一点问题,但不知道它是什么。C++“class”does not name a type
header.h:
#ifndef CONTINENT_H_INCLUDED
#define CONTINENT_H_INCLUDED
#include <string>
#include <vector>
class Territory;
class Player;
namespace Sep
{
//----------------------------------------------------------------------------
// Continent class
// class consist of many territories
//
class Continent
{
private:
public:
//--------------------------------------------------------------------------
// Constructor
//
Continent();
//--------------------------------------------------------------------------
// Copy Constructor
// Makes a copy of another Continent Object.
// @param original Original to copy.
//
Continent(const Continent& original);
//--------------------------------------------------------------------------
// Assignment Operator
// Used to assign one Continent to another
// @param original Original with values to copy.
//
Continent& operator= (Continent const& original);
//--------------------------------------------------------------------------
// Destructor
//
INCLUDED
virtual ~Continent();
//--------------------------------------------------------------------------
// Constructor to forward attributes
//
Continent(std::string name, std::vector<Territory*> territories);
};
}
#endif // CONTINENT_H_INCLUDED
的.cpp:
#include "Continent.h"
//------------------------------------------------------------------------------
Continent::Continent()
{
}
//------------------------------------------------------------------------------
Continent::Continent(std::string name, std::vector<Territory*> territories) :
name_(name), territories_(territories)
{
}
//------------------------------------------------------------------------------
Continent::~Continent()
{
}
对不起,我把整个代码,但我不想冒任何风险。 ERROR: 克++ -Wall -g -c -o Continent.o Continent.cpp -MMD -MF ./Continent.od Continent.cpp:13:1:错误: '洲' 没有指定类型
从那我得到它是头定义和.cpp之间的问题,但最新的问题,我不能看到它。
THX任何帮助:)
你把它放到'namespace'中是有原因的,不是吗? 'Sep :: Continent :: Continent()' – 2013-04-09 21:15:18
在析构函数上面做那个流浪'INCLUDED'是什么? :) – fredoverflow 2013-04-09 21:20:54