Hi there,

I am trying to add a server feature to my project. My idea was to have the clients sent information to the server. These information are processed and displayed by the server. The server user needs to react on the information he gets from the clients or request more information. Actually I think the whole thing can be seen as an instant messaging system since server and client will be handled by a user.

To realize that I looked around and found the fortune server/client examples. So I just copied the code from server.h and server.cpp into my code and added "network" to Qt.
The code compiles without any errors but the program crashes right at the start. I do not get any error messages besides that it crashed.
This is the line that makes the trouble:
Qt Code:
  1. // Start Server
  2. QNetworkConfigurationManager manager;
  3. qDebug() << "Hello Server!";
  4. if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
  5. qDebug() << "Are you starting";
To copy to clipboard, switch view to plain text mode 
Hello Server appears in the console but are you starting not. The else statement is also not triggered. So I assume the if statement makes the trouble.
qDebug() << manager.capabilities(); gives me QFlags(0x10)

What could I have possibly missed? Where should I start looking?
The software I am writing for shall run on OS X. If I am running the example as stand alone it worked after I added #include <QWidget> to the .h file.

Any hints would be appreciated.