I was able to compile the following code:
Qt Code:
  1. #include <QTcpSocket>
  2. #include <QApplication>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication app(argc, argv);
  7. QTcpSocket * socket = new QTcpSocket();
  8. socket->connectToHost("imap.free.fr", 143);
  9. return app.exec();
  10. }
To copy to clipboard, switch view to plain text mode 

With this pro file:
Qt Code:
  1. ######################################################################
  2. # Automatically generated by qmake (2.01a) Fri Feb 23 09:05:34 2007
  3. ######################################################################
  4.  
  5. QT += network
  6. TEMPLATE = app
  7. TARGET =
  8. DEPENDPATH += .
  9. INCLUDEPATH += .
  10.  
  11. # Input
  12. SOURCES += main.cpp
To copy to clipboard, switch view to plain text mode 

mAx