这是我从make得到的错误:
In file included from ui/graphical/game/control/chatcommand/chatcommand.cpp:20:
ui/graphical/game/control/chatcommand/chatcommand.h:67:41: error:
implicit instantiation of undefined template 'cChatCommandParser<>'
return cChatCommandParser<NewArgument>(cChatCommandParser<>(std::move(*thi...
^
ui/graphical/game/control/chatcommand/chatcommand.h:27:7: note:
template is declared here
class cChatCommandParser;
^
chatcommand.h:
...
template<typename... Arguments>
class cChatCommandParser;
...
class cChatCommand
{
public:
...
template<typename NewArgument, typename... Args>
cChatCommandParser<NewArgument> addArgument(Args&&... args);
...
};
template<typename NewArgument, typename... Args>
cChatCommandParser<NewArgument> cChatCommand::addArgument(Args&&... args)
{
return cChatCommandParser<NewArgument>(cChatCommandParser<>(std::move(*this)), NewArgument(std::forward<Args>(args)...));
}
显而易见的解决方案是#include chatcommandparser.h
。不幸的是,chatcommandparser.h已经包含chatcommand.h。
解开这个最保守的方法是什么?我真的不知道这段代码在做什么,只想编译它。
请注意,GNU gcc可以毫无问题地进行编译。我正在尝试使用Apples gcc进行编译。