glooxボットがあります。MUCルームハンドラーを作成しようとしていますが、gccでコンパイルすると間違いが発生します。
class MucHandler : public MUCRoomHandler {
private:
Client *client;
public:
MucHandler(Client *cl){
client = cl;
}
virtual void handleMUCMessage (MUCRoom *room, const Message &msg, bool priv){
}
virtual bool handleMUCRoomCreation( MUCRoom *room )
{
}
virtual void handleMUCSubject( MUCRoom * /*room*/, const std::string& nick, const std::string& subject )
{
}
virtual void handleMUCInviteDecline(MUCRoom*, const JID& invitee, const string& reason){
}
virtual void handleMUCError(MUCRoom*, StanzaError error ){
}
virtual void handleMUCInfo( MUCRoom * /*room*/, int features, const std::string& name, const DataForm* infoForm )
{
}
virtual void handleMUCItems( MUCRoom * /*room*/, const Disco::ItemList& items )
{
}
virtual void handleMUCParticipantPresence(MUCRoom * room, const MUCRoomParticipant participant,Presence presence){
}
};
class Bot {
private:
Client *client;
MUCRoom *room;
MucHandler *muc;
public:
Bot(string login, string password, string resource){
const string fullJidName = login + '/' + resource;
JID jid(fullJidName);
//mucroom
const string server = "conference.jabber.ru";
const string uName = jid.username();
const string roomJid = uName + "@" + server + "/" + uName;
JID roomJID( roomJid );
client = new Client(jid,password);
client->setPresence( Presence::Available, -1 );
//mucRoom handler
muc = new MucHandler(client);
room = new MUCRoom( client, roomJID, muc, 0 );
//room->registerMUCRoomHandler(muc);
//
client->connect();
}
~Bot(){
delete client;
delete room;
}
void joinRoom(){
room->join();
room->getRoomInfo();
room->getRoomItems();
}
void setRoomNick(const string& nick){
room->setNick(nick);
}
void invite(const string& inv, const string& reason)
{
JID invitee(inv);
room->invite(invitee, reason);
}
};
int main(int argv, char** argc){
Bot bot("example3@gmail.com","example3","home");
}
しかし、私は間違いがあります
次の仮想関数は「MucHandler」/usr/include/gloox/mucroomhandler.h:107内で純粋であるため、抽象型「Muchandler」のオブジェクトを割り当てることはできません。 、gloox :: MUCRoomParticipant、const gloox :: Presence&)
どうやって直せばいいのかわからない。誰か助けてもらえますか?