PDA

View Full Version : cannot connect to X server



jcr
18th April 2007, 14:15
Hello,

I am trying to run:


#include <QApplication>
#include <QtCore>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
qWarning("hello");
return app.exec();
}

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.

jpn
18th April 2007, 14:22
QApplication is part of QtGui, QCoreApplication is part of QtCore.


#include <QCoreApplication>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
qWarning("hello");
return app.exec();
}