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. Compiling plugin with mingw

Compiling plugin with mingw

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 1.2k 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.
  • G Offline
    G Offline
    googie
    wrote on last edited by
    #1

    I ran into a problem that my application uses plugins driven by Qt plugins engine. The application provides simple interface class, just like Qt Plugins tutorial says.

    It works like a charm under Linux, but under Windows I have problem compiling plugins, because mingw (apparently all Windows compilers?) forces all symbols in plugin dll to be resolved at compile time. Why, oh, why?! All symbols will be resolved anyway when plugin gets loaded into the application.

    Do I really need to go through entire application and mark symbols to be exported?

    I already tried the fast way - I used dlltool to export all symbols from the exe file, but when I tried to compile plugin against generated .a file I received some linker error about duplicate mingw symbols... (looked like the exe file already has some symbols that dll tried to link again, or something like that).

    Is this really a thing? Isn't there any simpler way to handle that?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      googie
      wrote on last edited by
      #2

      Okay, so I did go through entire application and marked all symbols to be exported. Now I'm able to create proper *.a file and link plugins to it.

      Mingw compiles and links plugins dll, but now I have this strange problem.

      When I try to load the plugin, the plugin loader says that it cannot find some module.

      I loaded the dll into the dependency checker tool and it showed me that the dll has unresolved dependencies to QtCored.dll, SQLiteStudio.exe, etc...

      Those are dependencies that are already satisfied in SQLiteStudio.exe, which is loading this dll. Why doesn't it work?

      All unsatisfied dependencies in dll are satisfied by the exe application.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        googie
        wrote on last edited by
        #3

        Okay, problem solved.

        I was copying plugin dependencies (dlls) into plugins directory, while I should have been copying them into the application directory, not plugins subdirectory. It's the application that resolves dependencies and its directory is considered as "current" for plugin dependencies.

        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