How tell Qt Creator where to look for DLLs? (It loads bad libstdc++-6.dll from SysWOW64)
I am running Qt Creator 3.0 on Windows 7 64-bit with Qt 5.1.1 32-bit MinGW edition.
Compiling a project works fine but as soon as I try to debug it, I immediately get the error "During startup program exited with code 0xc0000139." This is apparently a DLL mismatch error of some sort.
With the help of depends.exe I copied all the DLLs needed into the same dir as the exe and then it ran fine.
After a lot of trial and error I tracked it down to a copy of libstdc++-6.dll inside C:\Windows\SysWOW64. For some reason, Qt Creator prefers this version to the one in Qt/5.1.1/mingw48_32/bin. If I rename the SysWOW64 version I'm able to launch the program in debug mode inside Qt Creator.
However, I don't want to be messing around in the Windows system folders if I can avoid it, there must be a better way around this? Can I specify the search order for DLLs that Qt Creator uses somehow?
The Qt directories containing the correct DLLs are actually first on the project's Run Environment PATH, but as the linked MSDN article explains, the system folders are searched before the PATH variable.
Maybe there is no other way around this than to always copy the affected DLL to the output dir before running the executable?
Any idea how libstdc++-6.dll got into your SYSWOW64 folder? That is not a Windows DLL and should never have been placed there in the first place. Any developer that adds things to C:\Windows and its subfolders should be smacked.
I'd say find the offending program and uninstall it. However, given that it didn't respect Windows system DLL rules, I'm guessing that even after an uninstallation, you'd still need to manually remove libstdc++-6.dll.