[solved] "QDnsLookup requires a QCoreApplication" - app output (qxmpp)



  • Hi,
    I'm trying to connect to server, but I can't - there is no error - only when I push the button "Connect" in my app I get this (in application output): "QDnsLookup requires a QCoreApplication" in place where I tries to connect to server
    @ userClient->connectToServer(config);@

    as it could be some mistake in qxmpp library, but it happens only on my PC computer, on my second computer it works fine.



  • I should also mention, that on PC server is running on virtual machine, and on other computer it isn't on virtual machine.



  • Now I write some code for check error (using error signal for QXmppClient).
    I get socket error, but as I mentioned it happens only on computer where is virtual machine, on my computer it works fine.


  • Lifetime Qt Champion

    Hi,

    Without more information it will be difficult to help you. What version of Qt are you using on what OS ?

    What error are you getting ?



  • On PC and on laptop I have Win7.
    Qt 5.1.1

    In constructor:
    @
    userClient=new QXmppCLient();
    connect(userClient,SIGNAL(error(QXmppClient::Error)),this,SLOT(getError(QXmppClient::error)));
    @

    in on_pbConnect_clicked():
    @
    QXmppConfiguration config;

    config.setUser(userName);
    config.setPassword(password);
    config.setHost(serverAddress);
    userClient->connectToServer(config);
    @
    userName, password, serverAddres (as IP address) I get from text fields.
    in getError:
    @
    if(e==QXmppClient::SocketError) ui->teMessage->append("Socket error");
    else if(e==QXmppClient::KeepAliveError) ui->teMessage->append("Keep Alive Error");
    else if (e==QXmppClient::XmppStreamError) ui->teMessage->append("Stream Error");
    else if(e==QXmppClient::NoError) ui->teMessage->append("No error");
    @

    I don't get any error while debugging or compiling. I can't connect to server. Before I add getError(QXmppClient::Error e) method in application output I got an information that "QDnsLookup requires a QCoreApplication". Now in my app in teMessage field I get that this is socket fault (SocketError).



  • i have same problem like this, so what is the answer for it?

    edit :
    i solved it, below is my solution

    Android:
    i had find out it needed to be use QCoreApplication.
    so, i create thread on android for it.

    Windows:
    you need to use same mode(debug or release) when you build your lib

    e.g.
    you use qxmpp, and build qxmpp in debug, you have to build your own project in debug when you use qxmpp.



  • hello i have 2 error. using qxmpp..

    mar feb 10 00:17:24 2015 DEBUG Looking up server for domain jabber.com
    QDnsLookup requires a QCoreApplication

    Images:

    http://picpaste.com/qxmpperror-Nung87qj.jpg

    http://picpaste.com/qxmpperror2-tPVEI9FC.jpg

    Please Help me..



  • hello i have 2 error. using qxmpp..

    mar feb 10 00:17:24 2015 DEBUG Looking up server for domain jabber.com
    QDnsLookup requires a QCoreApplication

    Images:

    http://picpaste.com/qxmpperror-Nung87qj.jpg

    http://picpaste.com/qxmpperror2-tPVEI9FC.jpg

    Please Help me..


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.