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. Cannot load dll when deploying

Cannot load dll when deploying

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 2.3k 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.
  • A Offline
    A Offline
    ayanamirei
    wrote on last edited by
    #1

    I write dbapi.dll myself in eclipse mingw (nothing to do with Qt), in the dll used iconv and winsock functions(static link).

    I can load dbapi.dll during Qt developing, both in debug and release setting. When I want to deploy the release version to another desktop (same win7 system), the dll cannot be loaded. Please advise what is wrong. Maybe I need some extra plugins in the release folder because using iconv, winsock functions?

    Code is like:

    @#ifndef CSHAREDDLL_H
    #define CSHAREDDLL_H

    #include <QLibrary>

    #include "dbapi.h" //the header file of dll

    typedef void (*tagSession)(HANDLE const handle);

    class CSharedDLL
    {
    public:
    tagSession funSession;

    public:
    CSharedDLL();
    bool load();

    private:
    QLibrary dbapi;
    };

    #endif // CSHAREDDLL_H
    @

    @
    #include "cshareddll.h"

    CSharedDLL::CSharedDLL():
    dbapi("dbapi.dll")
    {
    }

    bool CSharedDLL::load()
    {
    if (dbapi.load())
    {
    funSession=(tagSession)dbapi.resolve("runSession");
    return funSession;
    }
    else
    return false;
    }
    @

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, you could check what DLLs/plugins are actually loaded on your development machine.
      Download for example listdlls.exe from sysinternals.com, start your app and then run listdlls <yourappname> to get a list of all the dlls.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        frankiefrank
        wrote on last edited by
        #3

        I agree with hskoglund - but personally I use Dependency Walker on the deployment machine to see what's broken.

        "Roads? Where we're going, we don't need roads."

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          Yes Dependency Walker can be useful as well, but it has one great weakness: it does not show the plugins that Qt itself (and not Windows) needs, like qwindows.dll or qwebwiew.dll.

          So if you really want a list of all the dlls that needs to be copied to another PC, you need a better tool than Dependency Walker.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            frankiefrank
            wrote on last edited by
            #5

            @hskoglund I think the last time I used it to diagnose problems with deployment, it was showing me the Qt DLLs I was missing (and in another case I had some libraries expecting Qt 4 DLLs while the deployed project came with the Qt5 versions).

            I might be wrong. But anyway, i'll make sure to try out listdlls.exe when I encounter another problem like that.

            "Roads? Where we're going, we don't need roads."

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              [quote author="hskoglund" date="1395828859"]Yes Dependency Walker can be useful as well, but it has one great weakness: it does not show the plugins that Qt itself (and not Windows) needs, like qwindows.dll or qwebwiew.dll.[/quote]If you click "Profile" -> "Start Profiling", it will find those plugins.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • hskoglundH Offline
                hskoglundH Offline
                hskoglund
                wrote on last edited by
                #7

                Indeed, qwindows.dll showed up (!) maybe Dependency Walker isn't so bad after all :-)
                (but I still don't like those false warnings, like IESHIMS.DLL missing, that Dependency Walker sometimes shows, or maybe it's just my age showing.)

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  ayanamirei
                  wrote on last edited by
                  #8

                  Just solved. I used iconv functions in my dll, however libiconv-2.dll, not iconv.dll need to copy into the release folder. I download Dep walker and found that. Thanks guys.

                  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