Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Windows DLL and QT Question



  • Hallo,

    when the Programm starts all DLLs will be loaded. they are in the same directory as the executable.

    Now my question is:
    If I make a plugin system and the plugins are in subfolder plugins will they be able to access qt classes? Or do they need to have own copy of the dll in their folder?

    MyApp folder

    • Plugins\
      • Plugin1.dll
      • Plugin2.dll
    • myApp.exe
    • all qt.dlls


  • Hello!

    The plugins dynamic (shared) libraries should be added to your project and should be available in the application directory, otherwise it cannot find it to use. For example (MyProject.pro):

    LIBS += -L"your plugins path" -lpluginlibname

    Happy coding!


  • Lifetime Qt Champion

    Hi,

    Are you using Qt's plugin system ?



  • @SGaist said in Windows DLL and QT Question:

    Hi,

    Are you using Qt's plugin system ?

    Not at the moment.

    long time ago I wrote a Template called library_ptr which is practically a smart pointer for DLL and Interface. if you have 2 Classes in a dll it can load the second class as child_ptr which only destroys the class at the end and not the dll handle.

    If I call SetDllDirectoryW inside the Executable will it also apply for DLLs?


Log in to reply