我有一点问题,但不确定是什么。
标头.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()
{
}
很抱歉输入了整个代码,但我不想冒任何风险。错误:g++ -Wall -g -c -o Continent.o Continent.cpp -MMD -MF ./Continent.od Continent.cpp:13:1:错误:“大陆”没有命名类型
从那我知道这是标题定义和.cpp之间的问题,但是我看不到那里的问题。
谢谢任何帮助:)