Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

ssl/qsslcertificate.cpp:300:45: Error: illegal use of incomplete type‘struct X509’



  • g++ -c -include .pch/Qt5Network -pipe -msse2 -mfpmath=sse -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_USING_NAMESPACE -DQT_BUILD_NETWORK_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtNetwork -I../../include/QtNetwork/5.3.2 -I../../include/QtNetwork/5.3.2/QtNetwork -Ikernel -I../../include/QtCore/5.3.2 -I../../include/QtCore/5.3.2/QtCore -I../../include/QtCore -I.moc -o .obj/qsslcertificate.o ssl/qsslcertificate.cpp
    ssl/qsslcertificate.cpp: In the member function‘QByteArray QSslCertificate::version() const’:
    ssl/qsslcertificate.cpp:288:68: Error: illegal use of incomplete type ‘struct X509’
    /usr/local/include/openssl/ossl_typ.h:120:16: Error: Forward declaration of‘struct X509’
    ssl/qsslcertificate.cpp: In the member function‘QByteArray QSslCertificate::serialNumber() const’:
    ssl/qsslcertificate.cpp:300:45: Error: illegal use of incomplete type‘struct X509’
    /usr/local/include/openssl/ossl_typ.h:120:16: Error: Forward declaration of‘struct X509’
    ssl/qsslcertificate.cpp: In the member function‘QSslKey QSslCertificate::publicKey() const’:
    ssl/qsslcertificate.cpp:565:32: Error: illegal use of incomplete type‘struct X509’
    /usr/local/include/openssl/ossl_typ.h:120:16: Error: Forward declaration of‘struct X509’
    ssl/qsslcertificate.cpp:569:29: Error: illegal use of incomplete type‘struct EVP_PKEY’
    /usr/local/include/openssl/ossl_typ.h:93:16: Error: Forward declaration of‘struct EVP_PKEY’
    ssl/qsslcertificate.cpp:573:36: Error: illegal use of incomplete type‘struct EVP_PKEY’
    /usr/local/include/openssl/ossl_typ.h:93:16: Error: Forward declaration of‘struct EVP_PKEY’
    ssl/qsslcertificate.cpp:577:36: Error: illegal use of incomplete type‘struct EVP_PKEY’
    /usr/local/include/openssl/ossl_typ.h:93:16: Error: Forward declaration of‘struct EVP_PKEY’
    gmake[3]: *** [.obj/qsslcertificate.o] Error 1
    gmake[3]: Leave the directory “/home/oneu/Downloads/qt-everywhere-opensource-src-5.3.2/qtbase/src/network”
    gmake[2]: *** [sub-network-make_first] Error 2
    gmake[2]: Leave the directory “/home/oneu/Downloads/qt-everywhere-opensource-src-5.3.2/qtbase/src”
    gmake[1]: *** [sub-src-make_first] Error 2
    gmake[1]: Leave the directory “/home/oneu/Downloads/qt-everywhere-opensource-src-5.3.2/qtbase”
    gmake: *** [module-qtbase-make_first] Error 2
    [root@localhost qt-everywhere-opensource-src-5.3.2]#
    


  • @Christian-Ehrlicher
    Thank you.

    My openssl installation directory is “/usr/local/ssl”, and the ”/usr/local/include/openssl directory” is not link to ”/usr/local/ssl”;
    It is ok to execute the following command, the fail passed.

    rm -rf /usr/local/include/openssl     ////////remove the directory 
    ln -s /usr/local/ssl/include/openssl /usr/local/include/openssl     ////////link /usr/local/include/openssl to openssl installation directory
    

  • Lifetime Qt Champion

    And what's your question? And no we can't read chinese (or whatever your locale is) - you have to write in english.



  • @Christian-Ehrlicher
    Thank you,
    when I make the code of QT5.3.2, error as follows:

    g++ -c -include .pch/Qt5Network -pipe -msse2 -mfpmath=sse -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_USING_NAMESPACE -DQT_BUILD_NETWORK_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtNetwork -I../../include/QtNetwork/5.3.2 -I../../include/QtNetwork/5.3.2/QtNetwork -Ikernel -I../../include/QtCore/5.3.2 -I../../include/QtCore/5.3.2/QtCore -I../../include/QtCore -I.moc -o .obj/qsslcertificate.o ssl/qsslcertificate.cpp
    ssl/qsslcertificate.cpp: In the member function‘QByteArray QSslCertificate::version() const’:
    ssl/qsslcertificate.cpp:288:68: Error: illegal use of incomplete type ‘struct X509’
    /usr/local/include/openssl/ossl_typ.h:120:16: Error: Forward declaration of‘struct X509’
    ssl/qsslcertificate.cpp: In the member function‘QByteArray QSslCertificate::serialNumber() const’:
    ssl/qsslcertificate.cpp:300:45: Error: illegal use of incomplete type‘struct X509’
    /usr/local/include/openssl/ossl_typ.h:120:16: Error: Forward declaration of‘struct X509’
    ssl/qsslcertificate.cpp: In the member function‘QSslKey QSslCertificate::publicKey() const’:
    ssl/qsslcertificate.cpp:565:32: Error: illegal use of incomplete type‘struct X509’
    /usr/local/include/openssl/ossl_typ.h:120:16: Error: Forward declaration of‘struct X509’
    ssl/qsslcertificate.cpp:569:29: Error: illegal use of incomplete type‘struct EVP_PKEY’
    /usr/local/include/openssl/ossl_typ.h:93:16: Error: Forward declaration of‘struct EVP_PKEY’
    ssl/qsslcertificate.cpp:573:36: Error: illegal use of incomplete type‘struct EVP_PKEY’
    /usr/local/include/openssl/ossl_typ.h:93:16: Error: Forward declaration of‘struct EVP_PKEY’
    ssl/qsslcertificate.cpp:577:36: Error: illegal use of incomplete type‘struct EVP_PKEY’
    /usr/local/include/openssl/ossl_typ.h:93:16: Error: Forward declaration of‘struct EVP_PKEY’
    gmake[3]: *** [.obj/qsslcertificate.o] Error 1
    gmake[3]: Leave the directory “/home/oneu/Downloads/qt-everywhere-opensource-src-5.3.2/qtbase/src/network”
    gmake[2]: *** [sub-network-make_first] Error 2
    gmake[2]: Leave the directory “/home/oneu/Downloads/qt-everywhere-opensource-src-5.3.2/qtbase/src”
    gmake[1]: *** [sub-src-make_first] Error 2
    gmake[1]: Leave the directory “/home/oneu/Downloads/qt-everywhere-opensource-src-5.3.2/qtbase”
    gmake: *** [module-qtbase-make_first] Error 2
    [root@localhost qt-everywhere-opensource-src-5.3.2]#


  • Lifetime Qt Champion

    What openssl version do you use?



  • @Christian-Ehrlicher
    Thank you .

    Development environment: Fedora 14, QT5.3.2, openssl1.0.2k;


  • Lifetime Qt Champion

    Are you sure you don't have the header of openssl 1.1 installed? See https://bugreports.qt.io/browse/QTBUG-51553



  • @Christian-Ehrlicher
    Thank you.

    My openssl installation directory is “/usr/local/ssl”, and the ”/usr/local/include/openssl directory” is not link to ”/usr/local/ssl”;
    It is ok to execute the following command, the fail passed.

    rm -rf /usr/local/include/openssl     ////////remove the directory 
    ln -s /usr/local/ssl/include/openssl /usr/local/include/openssl     ////////link /usr/local/include/openssl to openssl installation directory
    

Log in to reply