Qt5 compilation error with openssl linked

My head will explode soon ... I want to compile qt with -openssl-linked so that openssl libraries are linked to qt libraries. I have already tried many options and my conclusion is when compilation is always:

ssl/qsslcertificate_openssl.cpp: In function 'uint qHash(const QSslCertificate&, uint)': ssl/qsslcertificate_openssl.cpp:63:30: error: invalid use of incomplete type 'X509 {aka struct x509_st}' return qHashBits(x509->sha1_hash, SHA_DIGEST_LENGTH, seed); ^ In file included from /usr/local/include/openssl/crypto.h:131:0, from /usr/local/include/openssl/comp.h:59, from /usr/local/include/openssl/ssl.h:148, from ../../include/QtNetwork/5.5.1/QtNetwork/private/../../../../../src/network/ssl/qsslcontext_openssl_p.h:53, from ../../include/QtNetwork/5.5.1/QtNetwork/private/qsslcontext_openssl_p.h:1, from ssl/qsslsocket_p.h:55, from ssl/qsslsocket_openssl_p.h:63, from ssl/qsslsocket_openssl_symbols_p.h:64, from ssl/qsslcertificate_openssl.cpp:35: /usr/local/include/openssl/ossl_typ.h:160:16: note: forward declaration of 'X509 {aka struct x509_st}' typedef struct x509_st X509; 

I compiled openssl and tried qt compilation by passing my compiled libraries:

 OPENSSL_LIBS='-L/opt/openssl_build/lib -lssl -lcrypto' ./configure -prefix /opt/qt5.5.1_linux_staticssl -opensource -confirm-license -release -nomake examples -nomake tests -static -openssl -no-opengl -no-libpng -no-pulseaudio -no-linuxfb -no-gif -no-gstreamer -no-gtkstyle -no-directfb -no-gui -no-eglfs -no-glib -I /opt/openssl_build/include/openssl -L /opt/openssl_build/lib -no-xcb 

I know that the error seems to load the old openssl libraries, but I already tried to change this path so that it could not find them and force them to load new ones. I do not know what else to do. Qt version is 5.5.1 openssl 1.0.1 and g ++ 5.2.

+6
source share
1 answer

I had to build Qt with openssl version 1.0.1, I don’t know if it works with 1.0.2. I had to change the path to the openssl libraries of the system so that Qt was forced to use the ones I created. The lines for compiling openssl running in the source directory:

 ./config --prefix=/opt/openssl_build_stable -shared make make test sudo make install 

My conf line for Qt:

 OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ./configure -prefix /opt/qt5.5.1_linux_staticssl -opensource -confirm-license -release -nomake examples -nomake tests -static -openssl-linked -I /opt/openssl_build_stable/include/openssl -L /opt/openssl_build_stable/lib 

Thanks simon-warta p>

+5
source

All Articles