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

Qt4 Cross compile Error



  • I had an error while building qt to send E-mail using SMTP in Qt on Arm Board.
    We proceeded as follows. What's the problem?

    1. Download openssl (Openssl ver: 1.1.1d)

    2. Openssl cross compile
      ./Configue linux-arm4 -march=armv5te shared --cross-complie-prifix=/home/use/Toolchain/gcc-4.4.4-glibc-2-11.1-multilib-1.0/arm-fsl-linux/arm- linux- --prefix=/home/use/build_openssl

    3. build OK (create /home/use/build_openssl/lib/libcrypto.so and /home/use/build_openssl/lib/libssl.so)

    4. qt4.8.7 build in QT_Source folder.
      ./configue --prefix=/home/use/qt_build -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -release -opensource -shared -confirm-license -no-largefile -no-accessibility -no-qt3support - no-multimedia -no-audio-backend -no-phonon -no-webkit -no-javascript-jit -no-script -no-scripttools -no-declarative -no-declarative-debug -system-zlib -system-libpng - system-libjpeg -no-libtiff -no-libtiff -no-libmng -no-gif -nis -no-cups -qt-mouse-tslib -nomake demos -nomake examples -qt-gfx-transformed -qt-freetype -v - svg -optimized-qmake -no-pch -no-nis OPENSSL_LIB="-L/home/use/build_openssl/lib -lssl -lcrypto" -openssl-linked

    5. An error occurred during Qt Build
      sl/qsslcertificate.cpp: In member function 'QByteArray QSslCertificate::version() const':
      ssl/qsslcertificate.cpp:264: error: invalid use of incomplete type 'struct x509_st'
      ../../include/QtNetwork/../../src/network/ssl/qsslcertificate.h:53: error: forward declaration of 'struct x509_st'
      ssl/qsslcertificate.cpp: In member function 'QByteArray QSslCertificate::serialNumber() const':
      ssl/qsslcertificate.cpp:279: error: invalid use of incomplete type 'struct x509_st'
      ../../include/QtNetwork/../../src/network/ssl/qsslcertificate.h:53: error: forward declaration of 'struct x509_st'
      ssl/qsslcertificate.cpp: In member function 'QSslKey QSslCertificate::publicKey() const':
      ssl/qsslcertificate.cpp:492: error: invalid use of incomplete type 'struct x509_st'
      ../../include/QtNetwork/../../src/network/ssl/qsslcertificate.h:53: error: forward declaration of 'struct x509_st'
      ssl/qsslcertificate.cpp:496: error: invalid use of incomplete type 'struct evp_pkey_st'
      /home/gene/share_folder/QT4.8.7_with_Openssl/build_openssl/include/openssl/ossl_typ.h:93: error: forward declaration of 'struct evp_pkey_st'
      ssl/qsslcertificate.cpp:500: error: invalid use of incomplete type 'struct evp_pkey_st'
      /home/gene/share_folder/QT4.8.7_with_Openssl/build_openssl/include/openssl/ossl_typ.h:93: error: forward declaration of 'struct evp_pkey_st'
      ssl/qsslcertificate.cpp:504: error: invalid use of incomplete type 'struct evp_pkey_st'
      /home/gene/share_folder/QT4.8.7_with_Openssl/build_openssl/include/openssl/ossl_typ.h:93: error: forward declaration of 'struct evp_pkey_st'
      Makefile:16867: recipe for target '.obj/release-shared-emb-arm/qsslcertificate.o' failed
      make[1]: *** [.obj/release-shared-emb-arm/qsslcertificate.o] Error 1
      make[1]: exit directory '/home/gene/share_folder/QT4.8.7_with_Openssl/QT_Source/qt-everywhere-opensource-src-4.8.7/src/network'
      Makefile:288: recipe for target 'sub-network-install_subtargets-ordered' failed
      make: *** [sub-network-install_subtargets-ordered] Error 2


  • Lifetime Qt Champion

    @programsc No, what I mean: delete the whole build folder and start from scratch


  • Lifetime Qt Champion

    @programsc said in Qt4 Cross compile Error:

    Openssl ver: 1.1.1d

    I don't think Qt4 supports OpenSSL 1.1.
    You should use 1.0 or even older (according to https://doc.qt.io/archives/qt-4.8/requirements.html >= 0.9.7, but 1.1 will for sure not work as it is not compatible with 1.0).



  • thank you for your reply
    Openssl was restarted using 1.0.2u, but the following error occurred.

    make[1]: exit directory '/home/gene/share_folder/QT4.8.7_with_Openssl/QT_Source/qt-everywhere-opensource-src-4.8.7/src/xml'
    cd src/network/ && make -f Makefile install
    make[1]: Enter directory '/home/gene/share_folder/QT4.8.7_with_Openssl/QT_Source/qt-everywhere-opensource-src-4.8.7/src/network'
    make[1]: *** target '/home/gene/share_folder/QT4.8.7_with_Openssl/build_openssl/include/openssl/cryptoerr.h' required from '.obj/release-shared-emb-arm/qsslcertificate.o' There are no rules to create . stoppage.
    make[1]: exit directory '/home/gene/share_folder/QT4.8.7_with_Openssl/QT_Source/qt-everywhere-opensource-src-4.8.7/src/network'
    Makefile:288: recipe for target 'sub-network-install_subtargets-ordered' failed
    make: *** [sub-network-install_subtargets-ordered] Error 2


  • Lifetime Qt Champion

    @programsc You should complete clean rebuild



  • @jsulm

    Yes, i proceeded with make after make clean


  • Lifetime Qt Champion

    @programsc No, what I mean: delete the whole build folder and start from scratch



  • @jsulm
    Thank you
    We have solved the problem with your help.


Log in to reply