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. Using .dll in QT
Qt 6.11 is out! See what's new in the release blog

Using .dll in QT

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.0k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Dear all:
    I survey some documents. I only know maybe I can use "QLibrary" to take symbol in my .dll. Now the problem is how can I use symbol in my .dll.For example if I had a class named "TakeIt", how should I do that I can use this class in my QT!?? Thanks.

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

      Hi,

      If it's your own dll, then you have the corresponding includes and lib file thus you can use the same technique like for any other framework.
      @
      INCLUDEPATH += path_to_your_includes
      LIBS += -Lpath_to_your_lib_file -llibrary_name
      @

      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
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Thanks. It's not my dll which release from manufacturer. I checked document about "QLibrary", does it only can use on "function" symbol? Because I implemented on other framework, I just set up reference and I can call the whole class that I want in my program.So, I want to know if I call class which is packeted into .dll file, how should I do in QT??

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dbzhang800
          wrote on last edited by
          #4

          Hi lvan1120,

          Generally speaking,
          the managed dll which is generated by .net framework can not be access by native C++ directly. So it can not be used in Qt directly.

          You need to use C or C++ API provided by the device manufacturer or OS.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Thanks. I see: )).By the way, if I want to use whole class in .dll file or .lib file from C or C++, I just do that SGaist said and include .h file, right!?

            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