Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8326713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:51:25+00:00 2026-06-09T00:51:25+00:00

I have gloox Bot. I’m trying to create MUC room handler, but now I

  • 0

I have gloox Bot. I’m trying to create MUC room handler, but now I have mistake, when I compile it under 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");
}

But I have mistake

cannot allocate an object of abstract type ‘Muchandler’
because the following virtual function are pure within ‘MucHandler’
/usr/include/gloox/mucroomhandler.h:107: note virtual void gloox::MUCRoomHandler::handlerMUCParticipantPresence(gloox::MUCRoom*, gloox::MUCRoomParticipant, const gloox::Presence&)

I have no idea, how to fix it. Can anybody help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:51:27+00:00Added an answer on June 9, 2026 at 12:51 am

    It means that there are pure virtual methods in MUCRoomHandler that you have not implemented in the derived class MucHandler. So, you have to implement them. You cannot instantiate an object with unimplemented member functions.

    Specifically, it mentions this method from MUCRoomHandler:

    virtual void handlerMUCParticipantPresence(MUCRoom*,
                                               MUCRoomParticipant, 
                                               const Presence&);
    

    You have implemented this, which is different (look at the parameter list):

    virtual void handleMUCParticipantPresence(MUCRoom * room, 
                                              const MUCRoomParticipant participant,
                                              Presence presence){ }   
    

    where I have removed the gloox namespaces for clarity.

    Since your implementation of handlerMUCParticipantPresence has different argument types, it doesn’t implement the pure virtual method. This is the source of the error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have a nice day. I got problem when trying to create an image from
have been trying couple of hours now to make my iphone app universal. The
Have a painfully simple blog Post creator, and I'm trying to check if the
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in
Have searched for the answer but no joy, so here goes... I'm working on
I have this code that make an image animation, but I want to call
Have a (rather complex) app that works fine on iOS 4 but fails on
Have been working in Ruby for a while, but usually in the context of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.