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. How to remove dependancy to library libQt5Network ?
Forum Updated to NodeBB v4.3 + New Features

How to remove dependancy to library libQt5Network ?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 726 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.
  • CutiUserC Offline
    CutiUserC Offline
    CutiUser
    wrote on last edited by
    #1

    Hello
    I wrote a standalone program in C++/Qt5 which does not use the network and in the dependencies of my executable I see (with the ldd command, under Linux) the libQt5Network library.

    How could I do to stop dragging this library which seems useless for my project, please ?

    Christian EhrlicherC 1 Reply Last reply
    0
    • SGaistS SGaist

      Hi,

      Try with:

      QT -= network
      

      If memory serves well, it's part of the default set of modules loaded.

      CutiUserC Offline
      CutiUserC Offline
      CutiUser
      wrote on last edited by
      #5

      I found the solution (thanks to your posts).

      To have a dependency with the libQt5Network library, you just have to add in the .pro :

      QT += xmlpatterns
      

      And in the code:

      #include <QXmlSchemaValidator>
      
      QXmlSchema schema;
      
      1 Reply Last reply
      0
      • CutiUserC CutiUser

        Hello
        I wrote a standalone program in C++/Qt5 which does not use the network and in the dependencies of my executable I see (with the ldd command, under Linux) the libQt5Network library.

        How could I do to stop dragging this library which seems useless for my project, please ?

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @CutiUser said in How to remove dependancy to library libQt5Network ?:

        How could I do to stop dragging this library which seems useless for my project, please ?

        Don't link against it. When you use qmake you've QT += network in your pro-file. Or maybe you're using a component which has QtNetwork as dependency (like e.g. QWebSockets)

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        CutiUserC 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @CutiUser said in How to remove dependancy to library libQt5Network ?:

          How could I do to stop dragging this library which seems useless for my project, please ?

          Don't link against it. When you use qmake you've QT += network in your pro-file. Or maybe you're using a component which has QtNetwork as dependency (like e.g. QWebSockets)

          CutiUserC Offline
          CutiUserC Offline
          CutiUser
          wrote on last edited by
          #3

          @Christian-Ehrlicher in my .pro file, I use :

          QT += widgets \
              opengl \
              xml \
              xmlpatterns
          

          And no network widget, a priori...
          It is possible to find the list of libraries used by the widgets ?

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

            Hi,

            Try with:

            QT -= network
            

            If memory serves well, it's part of the default set of modules loaded.

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

            CutiUserC 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Try with:

              QT -= network
              

              If memory serves well, it's part of the default set of modules loaded.

              CutiUserC Offline
              CutiUserC Offline
              CutiUser
              wrote on last edited by
              #5

              I found the solution (thanks to your posts).

              To have a dependency with the libQt5Network library, you just have to add in the .pro :

              QT += xmlpatterns
              

              And in the code:

              #include <QXmlSchemaValidator>
              
              QXmlSchema schema;
              
              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