Results 1 to 2 of 2

Thread: cannot connect to X server

  1. #1
    Join Date
    Jan 2006
    Posts
    73
    Thanks
    16
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default cannot connect to X server

    Hello,

    I am trying to run:
    Qt Code:
    1. #include <QApplication>
    2. #include <QtCore>
    3. int main(int argc, char *argv[])
    4. {
    5. QApplication app(argc, argv);
    6. qWarning("hello");
    7. return app.exec();
    8. }
    To copy to clipboard, switch view to plain text mode 
    on my linux server (Fedorac Core 4). This is a vps and I don't have gui access; pure server here. Compilation is fine but executing the app returns:
    fortuneserver: cannot connect to X server

    Following some googling (and without knowing exactly what I was doing), I also tried
    ./fortuneserver -display :0.0
    but that returns after a delay:
    fortuneserver: cannot connect to X server :0.0
    How I solve that X server problem?

    My goal is to write a local GUI qt app that interacts with a server so that all users of that app have their GUI updated by the actions of the others. Since I am a bit new with socket and networking thing, I was thinking of starting off with that fortuneserver example. Is there a place with examples of qt app without GUI? Or maybe something that does what I'd like to do (maybe a game) so that I can get ideas on the design.

    Many thanks in advance.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: cannot connect to X server

    QApplication is part of QtGui, QCoreApplication is part of QtCore.
    Qt Code:
    1. #include <QCoreApplication>
    2. int main(int argc, char *argv[])
    3. {
    4. QCoreApplication app(argc, argv);
    5. qWarning("hello");
    6. return app.exec();
    7. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    jcr (18th April 2007)

Similar Threads

  1. How a server can write "Hello" to a browser ?
    By probine in forum Qt Programming
    Replies: 2
    Last Post: 1st December 2006, 15:43
  2. Replies: 5
    Last Post: 28th August 2006, 15:36
  3. Using QTcpSockt to check an IMAP server
    By guilugi in forum Qt Programming
    Replies: 12
    Last Post: 20th March 2006, 09:51
  4. connect to sql server
    By raphaelf in forum Qt Programming
    Replies: 15
    Last Post: 27th February 2006, 19:06
  5. synching client readings to server output
    By OnionRingOfDoom in forum Qt Programming
    Replies: 14
    Last Post: 28th January 2006, 19:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.