Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSsl Configuration in VS2013 strange error
QtWS25 Last Chance

QSsl Configuration in VS2013 strange error

Scheduled Pinned Locked Moved Unsolved General and Desktop
qsslconfiguratiopensslqtnetworkvs 2013
9 Posts 3 Posters 4.1k Views
  • 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.
  • N Offline
    N Offline
    Ni.Sumi
    wrote on 10 Jun 2016, 09:29 last edited by Ni.Sumi 6 Oct 2016, 09:46
    #1

    Hi all,

    I have Qt 4.8.6 custom build with Vs 2013. In my project every thing it works fine except the QSslConfiguration.
    I have this in my header :

    #include <QSslConfiguration>

    HTTPDataReader::HTTPDataReader(){
    QSslConfiguration sslconfigure(QSslConfiguration::defaultConfiguration());// error line
    }

    This line giving me errors with VS IDE (Qt 4.8.6 custom build with Vs 2013), but same file with Qt creator as IDE and same compiler(Qt 4.8.6 with Vs 2013) it works. Any idea to solve this. It seems , VS is missed some thing . Is there any way to check all my includes are working or not?

    It showing the errors :
    Error 1 error C2027: use of undefined type 'QSslConfiguration'
    Error 2 error C3861: 'defaultConfiguration': identifier not found
    Error 3 error C2079: 'sslconfigure' uses undefined class 'QSslConfiguration'
    Error 4 error C2027: use of undefined type 'QSslConfiguration'
    Error 5 error C3861: 'defaultConfiguration': identifier not found
    Error 6 error C2079: 'sslconfigure' uses undefined class 'QSslConfiguration'
    Error 7 error C2027: use of undefined type 'QSslConfiguration'
    Error 8 error C3861: 'defaultConfiguration': identifier not found

    thanks ,
    Ni.Sumi

    1 Reply Last reply
    1
    • V Offline
      V Offline
      VRonin
      wrote on 10 Jun 2016, 12:22 last edited by VRonin 6 Oct 2016, 12:22
      #2

      did you forget to add the QtNetwork model to the VS project?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Ni.Sumi
        wrote on 10 Jun 2016, 12:36 last edited by Ni.Sumi 6 Oct 2016, 12:37
        #3

        @VRonin ,

        you mean in the .pro ? If yes, I have added it and all other stuff like QNetworkAccessManager manager; QNetworkReply* reply are working fine. I have these errors only for the QSSlConfiguration and the QSslError .

        But currently, I don't have pro file with my project, I have build the project using the Cmake.

        K V 2 Replies Last reply 10 Jun 2016, 13:21
        0
        • N Ni.Sumi
          10 Jun 2016, 12:36

          @VRonin ,

          you mean in the .pro ? If yes, I have added it and all other stuff like QNetworkAccessManager manager; QNetworkReply* reply are working fine. I have these errors only for the QSSlConfiguration and the QSslError .

          But currently, I don't have pro file with my project, I have build the project using the Cmake.

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 10 Jun 2016, 13:21 last edited by
          #4

          @Ni-Sumi
          Hello Ms. Sumi,
          Perhaps you could check what was generated for the Makefile? If the appropriate include paths were passed on by CMake?

          Kind regards.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          2
          • N Offline
            N Offline
            Ni.Sumi
            wrote on 10 Jun 2016, 13:46 last edited by Ni.Sumi 6 Oct 2016, 13:50
            #5

            Hi Mr. @kshegunov ,

            Yes, I have checked the file and I can see that this line

            //Path to a file.
            QT_QTNETWORK_INCLUDE_DIR:PATH=C:/Qt/qt4.8.6_vs12/include/QtNetwork

            //The Qt QTNETWORK library
            QT_QTNETWORK_LIBRARY:STRING=optimized;C:/Qt/qt4.8.6_vs12/lib/QtNetwork4.lib;debug;C:/Qt/qt4.8.6_vs12/lib/QtNetworkd4.lib

            //Path to a library.
            QT_QTNETWORK_LIBRARY_DEBUG:FILEPATH=C:/Qt/qt4.8.6_vs12/lib/QtNetworkd4.lib

            //Path to a library.
            QT_QTNETWORK_LIBRARY_RELEASE:FILEPATH=C:/Qt/qt4.8.6_vs12/lib/QtNetwork4.lib

            K 1 Reply Last reply 10 Jun 2016, 17:21
            0
            • N Ni.Sumi
              10 Jun 2016, 13:46

              Hi Mr. @kshegunov ,

              Yes, I have checked the file and I can see that this line

              //Path to a file.
              QT_QTNETWORK_INCLUDE_DIR:PATH=C:/Qt/qt4.8.6_vs12/include/QtNetwork

              //The Qt QTNETWORK library
              QT_QTNETWORK_LIBRARY:STRING=optimized;C:/Qt/qt4.8.6_vs12/lib/QtNetwork4.lib;debug;C:/Qt/qt4.8.6_vs12/lib/QtNetworkd4.lib

              //Path to a library.
              QT_QTNETWORK_LIBRARY_DEBUG:FILEPATH=C:/Qt/qt4.8.6_vs12/lib/QtNetworkd4.lib

              //Path to a library.
              QT_QTNETWORK_LIBRARY_RELEASE:FILEPATH=C:/Qt/qt4.8.6_vs12/lib/QtNetwork4.lib

              K Offline
              K Offline
              kshegunov
              Moderators
              wrote on 10 Jun 2016, 17:21 last edited by
              #6

              @Ni-Sumi
              It is strange indeed. What about the compile lines from QtCreator and VS, you mentioned everything works fine with creator? Can you check the compile line for the offending file for each of the IDEs and post it here, there must be some flag that's missing ... or something of this sort ...

              Read and abide by the Qt Code of Conduct

              1 Reply Last reply
              1
              • N Ni.Sumi
                10 Jun 2016, 12:36

                @VRonin ,

                you mean in the .pro ? If yes, I have added it and all other stuff like QNetworkAccessManager manager; QNetworkReply* reply are working fine. I have these errors only for the QSSlConfiguration and the QSslError .

                But currently, I don't have pro file with my project, I have build the project using the Cmake.

                V Offline
                V Offline
                VRonin
                wrote on 13 Jun 2016, 07:12 last edited by
                #7

                @Ni.Sumi The .pro file seems to work fine here as the problem do not arise when calling qmake
                Visual Studio IDE does not use the .pro file however, you should check that your VS project has $(QTDIR)\include\QtNetwork as part of the "Additional Include Directories" (if you are using Qt VS addin just check Qt Network checkbox in the qt configuration of the project

                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                ~Napoleon Bonaparte

                On a crusade to banish setIndexWidget() from the holy land of Qt

                1 Reply Last reply
                2
                • N Offline
                  N Offline
                  Ni.Sumi
                  wrote on 13 Jun 2016, 11:20 last edited by Ni.Sumi
                  #8

                  Hi @VRonin ,

                  yes, Seems this is my problem. I have made a test project with checking and without Q Network at beginning of the project. Yes, the project with checked QNetwork did not go well.

                  But I have created the project using the CMake, which is different way of creating Qt projects in the VS IDE from Menu/QtAddin (Nothing likenew project , next naming source files, check Qt widgets, Networks, OpenL etc...).

                  Cold you please let me know , how can I do checking the QtNetwork this now in between the project ? ?? they must be way to do this. This is CMAKE file line which has all Qt link
                  target_link_libraries(${PROJECT_NAME} Qt4::QtCore Qt4::QtDeclarative Qt4::QtDesigner Qt4::QtDesignerComponents Qt4::QtGui Qt4::QtOpenGL Qt4::QtNetwork Qt4::QtTest Qt4::QtXml Qt4::QtXmlPatterns)
                  http://postimg.org/image/elqdpl6q9/ in VS linking
                  But its completely strange for me, all network related stuff like QNetwork, QNetworkReply worked fine, the problem started only when I started adding #include QSslConfiguration and QSslErrors.

                  @kshegunov ,
                  Yes, In Qt creator it works fine with the same complier(Vs 2013 with qt 4.8.6). And this si the error line which is causing the probelm in my project.
                  QSslConfiguration sslconfigure(QSslConfiguration::defaultConfiguration());// error line
                  amd these are errors
                  error C2027: use of undefined type 'QSslConfiguration'
                  error C3861: 'defaultConfiguration': identifier not found
                  error C2079: 'sslconfigure' uses undefined class 'QSslConfiguration'

                  K 1 Reply Last reply 13 Jun 2016, 15:44
                  0
                  • N Ni.Sumi
                    13 Jun 2016, 11:20

                    Hi @VRonin ,

                    yes, Seems this is my problem. I have made a test project with checking and without Q Network at beginning of the project. Yes, the project with checked QNetwork did not go well.

                    But I have created the project using the CMake, which is different way of creating Qt projects in the VS IDE from Menu/QtAddin (Nothing likenew project , next naming source files, check Qt widgets, Networks, OpenL etc...).

                    Cold you please let me know , how can I do checking the QtNetwork this now in between the project ? ?? they must be way to do this. This is CMAKE file line which has all Qt link
                    target_link_libraries(${PROJECT_NAME} Qt4::QtCore Qt4::QtDeclarative Qt4::QtDesigner Qt4::QtDesignerComponents Qt4::QtGui Qt4::QtOpenGL Qt4::QtNetwork Qt4::QtTest Qt4::QtXml Qt4::QtXmlPatterns)
                    http://postimg.org/image/elqdpl6q9/ in VS linking
                    But its completely strange for me, all network related stuff like QNetwork, QNetworkReply worked fine, the problem started only when I started adding #include QSslConfiguration and QSslErrors.

                    @kshegunov ,
                    Yes, In Qt creator it works fine with the same complier(Vs 2013 with qt 4.8.6). And this si the error line which is causing the probelm in my project.
                    QSslConfiguration sslconfigure(QSslConfiguration::defaultConfiguration());// error line
                    amd these are errors
                    error C2027: use of undefined type 'QSslConfiguration'
                    error C3861: 'defaultConfiguration': identifier not found
                    error C2079: 'sslconfigure' uses undefined class 'QSslConfiguration'

                    K Offline
                    K Offline
                    kshegunov
                    Moderators
                    wrote on 13 Jun 2016, 15:44 last edited by
                    #9

                    @Ni.Sumi
                    I mean the compiler invocation, not the error (I saw the error in your first post). It should look something like this:

                    g++ -c -pipe -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../myproject -I. -I../../../qt/qt-5.6/qtbase/include -I../../../qt/qt-5.6/qtbase/include/QtWidgets -I../../../qt/qt-5.6/qtbase/include/QtGui -I../../../qt/qt-5.6/qtbase/include/QtCore -I. -I../../../qt/qt-5.6/qtbase/mkspecs/linux-g++ -o somesource.o ../../myproject/somesource.cpp
                    

                    / I've taken it from g++, but you get the idea - the compile line, the call that compiles the offending source. /

                    Kind regards.

                    Read and abide by the Qt Code of Conduct

                    1 Reply Last reply
                    0

                    2/9

                    10 Jun 2016, 12:22

                    topic:navigator.unread, 7
                    • Login

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