PDA

View Full Version : QFileDialog causing crash "exited with code -1073741511" with 64-bit Qt



gib
24th July 2013, 18:33
I have been working with the Qt SDK on Windows 7 64-bit, using the supplied 32-bit binaries. Now I need to use 64-bit code, so I built Qt from source with MSVS 10.0. As far as I could tell the build completed without error. I have been trying to transfer one of my programs to the 64-bit version. I am using cmake (for the first time with Qt Creator) because I need to link with ITK libraries. My test program fails immediately, in Qt Creator with error -1073741511, and outside Qt Creator with this message:

The procedure entry point ??4QString@@QEAAAEAV0@$$QEAV0@@Z could not be located in the dynamic link library QtCore4.dll

If I remove code references to QFileDialog::getOpenFileName and QFileDialog::getSaveFileName the program executes correctly. Note that these QFileDialog functions are not called, it is just their presence in the code that causes the crash.

I notice that there are (32-bit) versions of QtCore4.dll in many places on my disk, but I assumed that the Qt Creator setup would ensure that the correct one was found. All suggestions are welcomed :)

Added after 41 minutes:

I now find that if I copy QtCore4.dll and QtGui4.dll to the execution directory the program executes correctly outside Qt Creator. So it's just a question of Qt Creator being able to find the 64-bit dlls. What's the best way to make this happen?

Infinity
24th July 2013, 19:37
Try to add the directory where your libraries are stored to the PATH variable in the build/execution environment.