LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-24-2011, 11:36 PM   #1
tarunchawla
Member
 
Registered: Mar 2010
Location: New Delhi,India
Distribution: Ubuntu 14.04
Posts: 117

Rep: Reputation: 3
making a chat client using gloox


#include<gloox/gloox.h>
#include<gloox/jid.h>
#include<gloox/client.h>
#include<iostream>
using namespace std;using namespace gloox;
class myclassublic ConnectionListener
{
public:
virtual void onConnect();
virtual void onDisconnect();
virtual bool onTLSConnect( );
};
bool myclass:nTLSConnect( )
{
return true;
}
void myclass:nConnect()
{
cout<<"connetcion";
}
void myclass:nDisconnect()
{
cout<<"disconnect";
}
class client
{
Client *c;
public:
void dos()
{
JID j("trnkumarchawla@gmail.com");
c=new Client(j,"ece",5222);
//c.setServer("talk.google.com",5222);

myclass *m=new myclass();
c->registerConnectionListener(m);
if(c->connect(false))
cout<<"connection";

}

};
int main()
{
client *g=new client;
g->dos();
}


I have write the above code using gloox library but it is showing following error what is the problem with it.....

client.cpp:7: error: invalid use of incomplete type ‘struct gloox::ConnectionListener’
/usr/include/gloox/clientbase.h:40: error: forward declaration of ‘struct gloox::ConnectionListener’
client.cpp: In member function ‘void client::dos()’:
client.cpp:36: error: no matching function for call to ‘gloox::Client::registerConnectionListener(myclass*&)’
/usr/include/gloox/clientbase.h:354: note: candidates are: void gloox::ClientBase::registerConnectionListener(gloox::ConnectionListener*)

Last edited by tarunchawla; 08-24-2011 at 11:38 PM.
 
Old 08-25-2011, 05:00 AM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by tarunchawla View Post
client.cpp:7: error: invalid use of incomplete type ‘struct gloox::ConnectionListener’
This error usually means that there's a header you've not included.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
making a chat client using gloox in c++ tarunchawla Programming 1 08-23-2011 02:38 PM
[SOLVED] chat client in c using gloox library tarunchawla Programming 2 08-18-2011 06:52 AM
Chat client for yahoo chat?? Joey.Dale Linux - Software 11 01-23-2004 03:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration