Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Compiler doesn't recognize QSslCertificate class when using static library
Forum Updated to NodeBB v4.3 + New Features

Compiler doesn't recognize QSslCertificate class when using static library

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 2 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    phuongvu_0203
    wrote on last edited by
    #1

    Hi everyone
    I want to build Qt 4.8.5 statically and it's done. Now, I config new qmake for Qt creator. But when I compile my application, I get this error
    @error: 'QSslCertificate' has not been declared@
    I'm using a QSslCertificate object in my project. The compiler with new static qmake doesn't recognize this class. I have included
    @#include <QtCore>
    #include <QtGui>
    #include <QtNetwork/QSslCertificate>
    #include <QtNetwork/QSslKey>@

    and no errors found when using shared library (I have both shared and static library in seperated path).

    Any problems with when ./configure parameter when I do build statically:
    @
    ./configure -prefix /usr/local/Trolltech/Qt-4.8.5_static -largefile -static -qt-libjpeg -qt-libpng -qt-libmng -qt-zlib -debug-and-release -phonon -phonon-backend -svg -dbus -script -qt-sql-mysql -multimedia -audio-backend -opengl -stl -glib -xrender -xshape -xcursor -xinput -xrandr -xfixes -xsync -xkb -xmlpatterns -fontconfig -glib -mitshm -sm -pch -nis -cups -gtkstyle -nomake demos -nomake examples -nomake tools
    @
    How can I build statically Qt library with all libraries?
    Please help me!!
    Thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAICS, you didn't enable any openssl option when building your static Qt

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        phuongvu_0203
        wrote on last edited by
        #3

        Thanks SGalst for your reply
        I have tried build Qt normally, I mean non-static.

        just ./configure
        make and make install

        After everything is done, I open my project and this shows the same error.
        @error: 'QSslCertificate' has not been declared@
        What do I have to do? rebuild Qt library again with openssl option enable?
        it takes me more than 2 hours :(

        1 Reply Last reply
        0
        • P Offline
          P Offline
          phuongvu_0203
          wrote on last edited by
          #4

          Does it required openssl installed? Because when I build Qt, the Ubuntu hasn't been installed openssl.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Yes it does

            Qt doesn't include OpenSSL

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • P Offline
              P Offline
              phuongvu_0203
              wrote on last edited by
              #6

              Hi SGaist
              After install openssl package
              I've re-build Qt4.8.5 no-static
              ./configurate
              make
              make install

              but it cannot find "QSslCertificate"

              @error: 'QSslCertificate' has not been declared@

              My project is using this class.
              I'm using Ubuntu 12.10 x64 and QtCreator 2.8.0

              1 Reply Last reply
              0
              • P Offline
                P Offline
                phuongvu_0203
                wrote on last edited by
                #7

                Hi, I figured out somthing...
                I've installed Qt4.8.5 on Ubuntu 12.10 32bits. It created "qmake-qt4" file located in /usr/bin and QtCreator using this file as Qt Version to compile qt project. When using that My project has no errors. When I config that linked Qt Version to "qmake" file located in /usr/local/Trolltech/Qt4.8.5/bin and compile my project, the errors:
                @error: 'QSslCertificate' has not been declared@
                appear. So, I use "qmake-qt4" as my current Qt Version on Ubuntu 12.10 32 bits.

                Now, I use the same Qt4.8.5 source code library to build on Ubuntu 64bits.
                After done, I cannot found "qmake-qt4" file in /usr/bin. My QtCreator cannot detect Qt Version automatically. So, I have to manually add Qt Version by browsing to "qmake" located in /usr/local/Trolltech/Qt4.8.5/bin and of course,
                @error: 'QSslCertificate' has not been declared@
                appear like on Ubuntu 32 bits.
                I wonder that, the reason either is my gcc 64 bits or Qt library source?
                I can't see the seperate sources for Ubuntu 32 bits and 64 bits. They use the same source code.
                Any ideas?
                Thank you

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  When configuring Qt check the log to see if it found openssl. If not add the -I and -L parameters to tell Qt where to find the includes and libs

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved