PDA

View Full Version : QSslSocket Problems



tntcoda
2nd July 2008, 16:41
Hi,

Im having some problems getting QSslSocket working, im using QDevelop with Qt 4.3.4.

I first got the error that QSslSocket header was not found, i fixed this by adding to the INCLUDEPATH variable: /usr/include/QtNetwork/ which is where qsslsocket.h is on my system. I could now compile with including <QSslSocket>.

As soon as i tried to use a class eg: socket = new QSslSocket(this);

I get the error:
nsocket.cpp:(.text+0x25): undefined reference to `QSslSocket::QSslSocket(QObject*)'
collect2: ld returned 1 exit status

So it sounds like there is a missing library somehow?

Any ideas on what im doing wrong here? Im using the default package provided by Arch Linux for Qt, and i have OpenSSL installed as well.

Thanks for any pointers,
Jack

jpn
2nd July 2008, 19:58
First of all, Qt must've been compiled with SSL support turned on. You should've seen configure output for details. :)

If your Qt was compiled with SSL support turned on, then it's only a matter of adding the following line in the .pro file of your app:

QT += network

lamptey007
24th December 2014, 21:26
I have this same type of problem and yes I have already added to my project file QT =+ network I feel the problem is that I'm missing openssl library but I've tried to install it and add the path of where I installed the openssl file to within my .pro file but maybe I'm not doing it right but no matter what I've tried so far, my program breaks the moment my program tries to use a ssl command. I tried testing for ssl support by using QSslSocket::supportsSsl() but the code just crashes even at that. Any clues?