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. Debugging plugins
Forum Updated to NodeBB v4.3 + New Features

Debugging plugins

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 572 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.
  • W Offline
    W Offline
    wasawi2
    wrote on last edited by
    #1

    Hello everyone,

    So I have been several days having problems to load one of my plugins. I had several examples with simple plugins which worked fine, but one of my plugins was a bit more complex.. loading several libraries and so on. At the end I realized that i could run the windeployqt.exe on my dll and found out i was missing several Qt dlls.

    My questions is, why there is no way that Qt can provide a well defined debugging system when loading plugins? Why qt did not tell me, "I'm missing these and that dll" ?

    I did try many ways to have meaningful debug info:

        // Set QT_DEBUG_PLUGINS programmatically
        #ifdef _WIN32
            _putenv("QT_DEBUG_PLUGINS=1");  // Windows-specific function
        #else
            setenv("QT_DEBUG_PLUGINS", "1", 1);  // Unix/Linux
        #endif
    
        QLoggingCategory::setFilterRules("qt.plugin.debug=true");
    

    which gave some useless information...

    I am puzzled because at the end, the problem was that i was missing some Qt dlls... so why is Qt unable to warn me about that?! is there something i am missing?

    Thank you for any tips!

    Christian EhrlicherC 1 Reply Last reply
    0
    • W wasawi2

      Hello everyone,

      So I have been several days having problems to load one of my plugins. I had several examples with simple plugins which worked fine, but one of my plugins was a bit more complex.. loading several libraries and so on. At the end I realized that i could run the windeployqt.exe on my dll and found out i was missing several Qt dlls.

      My questions is, why there is no way that Qt can provide a well defined debugging system when loading plugins? Why qt did not tell me, "I'm missing these and that dll" ?

      I did try many ways to have meaningful debug info:

          // Set QT_DEBUG_PLUGINS programmatically
          #ifdef _WIN32
              _putenv("QT_DEBUG_PLUGINS=1");  // Windows-specific function
          #else
              setenv("QT_DEBUG_PLUGINS", "1", 1);  // Unix/Linux
          #endif
      
          QLoggingCategory::setFilterRules("qt.plugin.debug=true");
      

      which gave some useless information...

      I am puzzled because at the end, the problem was that i was missing some Qt dlls... so why is Qt unable to warn me about that?! is there something i am missing?

      Thank you for any tips!

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @wasawi2 said in Debugging plugins:

      so why is Qt unable to warn me about that?

      I don't see how this should be possible without special handling (loading the dll, looking what dlls are imported, etc.) which is not trivial. The plugin is loaded by the os, the os simply tells Qt that it was not able to load the plugin but nothing more.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • W Offline
        W Offline
        wasawi2
        wrote on last edited by
        #3

        @Christian-Ehrlicher thank you,

        Ok… that makes sense… but i still find it very unfortunate. Even if it is the OS fault… it is quite unbelievable that such a common practice is almost impossible to debug properly… i tried the famous dependency walker but it gave me tons of misdirecting errors…

        I will then stick to the windeployqt.exe tool to make sure all the required dlls are in place… for now it has worked well.

        But i still feel im quite blind when it comes to debugging the loading of a plugin… i thought Qt would provide advanced tools for that.

        Thank you again @Christian-Ehrlicher .

        1 Reply Last reply
        0
        • W wasawi2 has marked this topic as solved on

        • Login

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