How the hell did QtTest4.dll enter the game?



  • I am trying to figure out why the release build of one of our applications has a dependency on QtTest4.dll. Our setup is as follows: we use our own (Visual C++ 2012) build of Qt 4.8.7. We haven an application, let's call it App.exe, that among others loads DLLs using QLibrary::load().

    When I investigate App.exe with Dependency Walker [1], I cannot see QtTest4.dll among the module dependencies. However, when I run App.exe and check what DLLs it loads at runtime using Process Explorer [2], then I do see QtTest4.dll being loaded. It is not clear to me how exactly QtTest4.dll comes in. Since I don't see it when I investigate App.exe using Dependency Walker, I assume it comes in through one of the DLLs that gets loaded at runtime, but I haven't found which one yet.

    Furthermore, what I do find strange is that neither the qmake .pro file of App.exe nor any other .pro file of the DLLs that get loaded, has 'Qt += testlib' in it. Doesn't QtTest4.dll come in just because of that line?

    My questions are:

    1. Is there a way to find out through what loaded DLL the QtTest4.dll comes in at runtime?
    2. Why could QtTest4.dll be among the release mode dependencies? None of the .pro files has testlib added to the QT variable...

    Any suggestions on how to debug this any further are more than welcome.

    [1] http://www.dependencywalker.com/
    [2] https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx


  • Moderators

    @Bart_Vandewoestyne said:

    1. Is there a way to find out through what loaded DLL the QtTest4.dll comes in at runtime?
    2. Why could QtTest4.dll be among the release mode dependencies? None of the .pro files has testlib added to the QT variable...

    I suggest you create a Debug build of your app, and run it from a debugger (e.g. WinDbg -- you need to first install Debugging Tools for Windows). It will slowly and gradually load the various libraries that your application wants, and you can see exactly when QtTest4.dll gets loaded.

    @Bart_Vandewoestyne said:

    When I investigate App.exe with Dependency Walker [1], I cannot see QtTest4.dll among the module dependencies. However, when I run App.exe and check what DLLs it loads at runtime using Process Explorer [2], then I do see QtTest4.dll being loaded. It is not clear to me how exactly QtTest4.dll comes in. Since I don't see it when I investigate App.exe using Dependency Walker, I assume it comes in through one of the DLLs that gets loaded at runtime

    Your last statement is probably right. By the way, you can make Dependency Walker show the runtime-loaded DLLs by clicking "Profile" -> "Start Profiling..."



  • @Bart_Vandewoestyne

    Just a thought, does your app load any plugins - either Qt ones or your own? If so check them as well for the dll. Same goes for any 3rd party dll's your app uses.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.