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. Best way to generate library ?
Forum Updated to NodeBB v4.3 + New Features

Best way to generate library ?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 1.3k 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.
  • LordfulL Offline
    LordfulL Offline
    Lordful
    wrote on last edited by
    #1

    Hello,

    I'm new at c++/Qt programming and I'm searching what is the best way to generate a library from a Qt project ?

    It seems that there is different possibilities over internet to build a library, but I can't choose which approach is the best for me.

    I must generate a library from a Qt project and then, I will use objects of this library in an other Qt project but I don't know if I must create a static library, a dynamic or a shared ..

    Thanks for your help and your explanation

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

      Hi
      It depends on your requirements
      http://stackoverflow.com/questions/2649334/difference-between-static-and-shared-libraries

      If you are not sure, I would go with dynamic/shared.

      So maybe I can ask

      Why do you need to make library ?

      1 Reply Last reply
      0
      • LordfulL Offline
        LordfulL Offline
        Lordful
        wrote on last edited by
        #3

        Thanks for your answer.

        I need to make a library because I created a module on an independent project and now, I must add this module to an application.

        I will check what you sent me.

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

          hi
          Qt has a system for loading dynamic library's in a platform independent way.
          Its called plugins-

          Please notice this term is used both for extending Qt tools and for extending
          an Qt applications.

          http://doc.qt.io/qt-5/plugins-howto.html
          and
          The Low-Level API: Extending Qt Applications

          1 Reply Last reply
          0
          • LordfulL Offline
            LordfulL Offline
            Lordful
            wrote on last edited by
            #5

            Hum ok so I can extend a Qt applications with a plugins which will load my dynamic library, am I right ?

            mrjjM 1 Reply Last reply
            0
            • LordfulL Lordful

              Hum ok so I can extend a Qt applications with a plugins which will load my dynamic library, am I right ?

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @Lordful
              well the plugin IS the library.
              and plugins can be loaded dynamically.
              So yes.

              please see
              http://doc.qt.io/qt-5/qtwidgets-tools-echoplugin-example.html
              for really basic sample
              here a string is returned from library.
              Could have been anything. including UI and classes.

              1 Reply Last reply
              1
              • LordfulL Offline
                LordfulL Offline
                Lordful
                wrote on last edited by
                #7

                Ok thanks for your informations, I will look at what you sent.

                Thanks mrjj.

                1 Reply Last reply
                1

                • Login

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