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 import external library at run time

How to import external library at run time

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 416 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.
  • S Offline
    S Offline
    saurabh162
    wrote on last edited by
    #1

    Dear Developers,

    Please inform me whether there is way to import external library in qt at run time.

    Right now I am importing external library for example "mcp2221_dll_um_x64" by using following lines in .pro file.

    win32: LIBS += -L$$PWD/3rdparty/libs/mcp2221lib/ -lmcp2221_dll_um_x64
    INCLUDEPATH += $$PWD/3rdparty/libs/mcp2221lib
    DEPENDPATH += $$PWD/3rdparty/libs/mcp2221lib
    

    But I want to import external libraries by passing their names in constructor of C++ class at runtime as follows:

    II2C_To_Serial("mcp2221_dll_um_x64");
    

    Please inform me whether there a way to do it.

    Please inform me if you need any other information from me.

    Thanks :)

    jsulmJ 1 Reply Last reply
    0
    • S saurabh162

      Dear Developers,

      Please inform me whether there is way to import external library in qt at run time.

      Right now I am importing external library for example "mcp2221_dll_um_x64" by using following lines in .pro file.

      win32: LIBS += -L$$PWD/3rdparty/libs/mcp2221lib/ -lmcp2221_dll_um_x64
      INCLUDEPATH += $$PWD/3rdparty/libs/mcp2221lib
      DEPENDPATH += $$PWD/3rdparty/libs/mcp2221lib
      

      But I want to import external libraries by passing their names in constructor of C++ class at runtime as follows:

      II2C_To_Serial("mcp2221_dll_um_x64");
      

      Please inform me whether there a way to do it.

      Please inform me if you need any other information from me.

      Thanks :)

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @saurabh162 If you want to load a library at runtime use https://doc.qt.io/qt-5/qlibrary.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • S Offline
        S Offline
        saurabh162
        wrote on last edited by
        #3

        @jsulm Thank you very much for the information I will try it out and update.

        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