The Linux Page

Qt and DLL mismatch / error

My Story

I'm using Qt under Linux and MS-Windows.

When I started with MS-Windows, I could not run the Release version. I thought the problem was because I was using a pre-compiled version of Qt 4.6.x and let it go for a while.

At some point, I finally upgraded to Qt 4.7.x thinking that would clear off that Release problem.

This time around, I actually compiled the library, see instructions here:

  Compile Qt 4.7.x with Visual Studio 10 (VC++ 2010)

The result was that a few bugs I noticed while running with 4.6.x were gone. Nice. However, I still couldn't run with the release version. Why would that be?

I just couldn't see why the system would find the QtCore4d.dll (debug version) and not the QtCore4.dll (release version) which were in the same folder! That's quite impressive to me.

When starting the application it would come up with a Message Box blocking the application until you click on OK. So I thought I could look at what the heck is going on using the System Internal tools.

Sure enough, I found my application (once I figured which sysinternal process to run?!)

So I opened the properties and looked for the libraries. The Qt libraries being loaded came from the wrong path! Namely:

C:\Windows\WinWOW64\Qt<name>.dll

Here we go! DLL Hell at its best. I checked the different libraries that were installed and they were coming from a product named Seavus. I uninstalled the product, the uninstallation properly removed the incompatible Qt libraries and I could then start my Release version of my application!

Solution

Go to your Control Panel, click on Programs and Features (this is under Windows 7), then search for Seavus. Click on it and select Uninstall (there should be such a button or use the right mouse button and use the menu.)

Note of Interest (another solution)

To avoid these problems, you could also make use of the configuration script command line that allows you to rename the Qt libraries to whatever you'd like (it appends a name such as Alexis: QtCore4Alexis.dll)

This way your Qt libraries are specific to you and you are really much less likely to run into problems.

One tool that uses that technique is Perforce. They actually add a P and include the major and minor versions (i.e. QtCoreP41.dll, QtCoreP42.dll, etc.) I mention this one because I found those Qt libraries before the Seavus offensive libraries. Since they had a different name, I just couldn't imagine that they could possibly be the problem and they weren't.