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. C ++ dll import qt project
Forum Updated to NodeBB v4.3 + New Features

C ++ dll import qt project

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 5 Posters 2.4k Views 5 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.
  • H hancan007

    How to import c++ dll into the qt project

    KroMignonK Offline
    KroMignonK Offline
    KroMignon
    wrote on last edited by
    #2

    @hancan007 Which build system are you using, qmake or cmake?

    https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html

    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hancan007
      wrote on last edited by
      #3

      qmake

      aca6de57-3fda-42dc-b683-22e221258a3c-image.png

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #4

        https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hancan007
          wrote on last edited by
          #5

          should i choose internal lib. Because I want to add ".dll" but qt is looking for my additions as ".lib"

          JKSHJ 1 Reply Last reply
          0
          • H hancan007

            How to import c++ dll into the qt project

            artwawA Offline
            artwawA Offline
            artwaw
            wrote on last edited by
            #6

            @hancan007 being sure that the external library is compiled accordingly just add external dynamic library, remember to set INCLUDENPATH in the pro file and #include the header file where appropriate in your code.

            If Qt is offering you lib file then most likely you are looking for the static one.

            For more information please re-read.

            Kind Regards,
            Artur

            1 Reply Last reply
            0
            • H hancan007

              should i choose internal lib. Because I want to add ".dll" but qt is looking for my additions as ".lib"

              JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #7

              @hancan007 said in C ++ dll import qt project:

              should i choose internal lib.

              Choose "Internal Library" if the library is part of your project.

              Choose "External Library" if the library is outside your project.

              I want to add ".dll" but qt is looking for my additions as ".lib"

              Usually a DLL comes with a .lib file and a .h file.

              If you don't have a .lib file -- where did you get this DLL from?

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • H Offline
                H Offline
                hancan007
                wrote on last edited by
                #8

                i have a .h file, but qt is looking for .lib instead of using .h

                mrjjM 1 Reply Last reply
                0
                • H hancan007

                  i have a .h file, but qt is looking for .lib instead of using .h

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

                  @hancan007

                  Hi
                  The .h defines what can be called and classes
                  The LIB file tells what DLL has exported
                  The DLL contains the actual code.

                  So it can't just use the H.
                  It needs all of it to work.

                  And most important the DLL must be made with a compatible compiler to what your app is using.

                  So if made with visual studio, you cannot use MinGW and reverse.

                  1 Reply Last reply
                  2
                  • H Offline
                    H Offline
                    hancan007
                    wrote on last edited by
                    #10

                    I found the .lib file how should I add it to my project

                    mrjjM JKSHJ 2 Replies Last reply
                    0
                    • H hancan007

                      I found the .lib file how should I add it to my project

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

                      @hancan007
                      Since there is a dll, i think its dynamic

                      So points to the LIB file and see. it should tell it to load the DLL at run time.

                      but this only works if same compilers.

                      1 Reply Last reply
                      0
                      • H hancan007

                        I found the .lib file how should I add it to my project

                        JKSHJ Offline
                        JKSHJ Offline
                        JKSH
                        Moderators
                        wrote on last edited by
                        #12

                        @hancan007 said in C ++ dll import qt project:

                        I found the .lib file how should I add it to my project

                        Earlier you said 'I want to add ".dll" but qt is looking for my additions as ".lib"'. So tell Qt Creator where to find your .lib file.

                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                        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