PDA

View Full Version : Qt4.8 to Qt5.1 sharedDLL



OverTheOCean
25th August 2013, 15:00
Hi,

moving my application from QT4.8 to QT5.1, on Windows7, using Qt creator 2.7.2, MingWin 4.8 32bits.

With Qt4.8, everything works well, moving to Qt5.1, l did the modifs with QtWidgets and other small diff.

When i run my application, during DLL loading, i get a runtime error, without specific errors.

In my Shared_Dll, l use Q_DECL_EXPORT, and dynamically load the DLL in my main program.

Without going into more details, is there something changed in Qt5.1 with shared library I should know about ? I spent some time reading doc and browsing the web, nothing obvious came up so far.

Would appreciate any insights.

rgds,

Michael

ChrisW67
26th August 2013, 05:02
is there something changed in Qt5.1 with shared library I should know about ?
Yes.
Deploying an Application on Windows: Creating the Application Package (http://qt-project.org/doc/qt-5.1/qtdoc/deployment-windows.html#creating-the-application-package)

OverTheOCean
26th August 2013, 20:32
doesn't seem much changed for deployment.

Further debugging, the "fatal error" occurs in the QT5Core.dll
GetProcAddress(0x77130000 [MSVCRT.DLL], "_get_output_format") called from "QT5CORE.DLL" at address 0x68A58EC9 and returned 0x771A5CE8.
Second chance exception 0xC0000005 (Access Violation) occurred in "QT5CORE.DLL" at address 0x688E2136.


but if i compile my DLL in Debug model, works fine !!

any tips why a DLL works fine in debug mode but not in Release ?

rgds,

Michael

OverTheOCean
31st August 2013, 22:16
[SOLVED]

I was declaring my class to access the DLL with " typedef __stdcall ", changing to typedef only fix the issue when compiling the .dll in release mode.
Not sure to understand why it made the calling function to crash, and why this is different from QT4.8 or GCC 4.7...

anyway.