[Qt-creator] Qt Creator + QSslSocket

Alexandre Beber listsbeber at gmail.com
Fri Nov 14 17:26:56 CET 2008


Hi there
I'm using Qt Creator v0.9 on a Windows Vista machine, and the Qt
version i'm using is the one shipped with QtCreator. I'm trying to
create a very simple app to test some QSslSocket stuff, but when i
create a class extending QSslSocket the compiler refuses to build it.
Here is the error part of what he says in the compile tab (Alt+4):

In file included from sslsocket.cpp:1:
sslsocket.h:7: error: expected class-name before '{' token
mingw32-make[1]: *** [debug/sslsocket.o] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project sslTest
When executing build step 'Make'


sslsocket.h and .cpp are pretty simple. They only have the default
code created by Qt Creator when you select "File -> New -> C++ Class".

Here they are:

//sslsocket.h
#ifndef SSLSOCKET_H
#define SSLSOCKET_H

#include <QSslSocket>

class SslSocket : public QSslSocket
{
public:
SslSocket();
};

#endif // SSLSOCKET_H

//sslsocket.cpp
#include "sslsocket.h"
SslSocket::SslSocket()
{
}

And my .pro file, if it helps:
# -------------------------------------------------
# Project created by QtCreator 2008-11-14T13:59:54
# -------------------------------------------------
QT += network
TARGET = sslTest
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp \
sslsocket.cpp
HEADERS += mainwindow.h \
sslsocket.h
FORMS += mainwindow.ui

I've done the same test on Windows XP SP3 machine and i got the same
problem. On a iMac with Mac OS Leopard it worked fine, so i'm not sure
if it is a Qt Creator bug or something i'm missing on the Windows PCs.
Other classes, like QTcpSocket, work fine...

So, anyone know how to make it run?
Thanks

Alexandre



More information about the Qt-creator-old mailing list