4
#ifndef UNO_ACTION_
#define UNO_ACTION_
namespace Uno
{
namespace Game
{
class Game;
}
} // namespace
namespace Uno
{
namespace Action
{
using ::Uno::Game::Game;
class Action
{
public:
virtual bool isDisposeable() = 0;
virtual void takeAction(Game* game) = 0;
virtual ~Action() {}
};
}
}
#endif
我彙編ubutun 12.04這些代碼,並將其返回設置錯誤:如何修正錯誤:未知類型名稱「命名空間」
action.h:4:1: error: unknown type name ‘namespace’
action.h:4:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
action.h:8:1: error: unknown type name ‘namespace’
action.h:8:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
我不知道如何解決這些錯誤。
你想混合使用C和C++代碼嗎? –
爲什麼C標記...?代碼是完整的C++ – Omkant
用'g ++'而不是用'gcc'編譯 – 2012-11-28 09:55:27