Apllication Crashs on Windows. Code Error:
-
When I try to start my application on Windows, I get a error message with co error "c0000005"
The same project, application on Linux works very very fine!@
#ifdef Q_OS_WINCE
int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR /wCmdParam/, int cmdShow)
#else
extern "C"
int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR /cmdParamarg/, int cmdShow)
#endif
{
//Error on this line (Below)
QByteArray cmdParam = QString::fromWCharArray(GetCommandLine()).toLocal8Bit(); //--> HERE IS THE ERROR!#if defined(Q_OS_WINCE)
wchar_t appName[MAX_PATH];
GetModuleFileName(0, appName, MAX_PATH);
cmdParam.prepend(QString(QLatin1String(""%1" ")).arg(QString::fromWCharArray(appName)).toLocal8Bit());
#endif
@Well First of all I don't create this code, is something form Qt!
I'm compiling using the last MinGW, the Qt 4.8.3 on Windows 7 32bits.
I don't know how to solve my problem!!!! -
MinGW 4.4 (used to build the prebuilt libraries) and MinGW 4.7 are not binary compatible.
If you want to use Qt with any other version of MinGW than 4.4 you will have to re-build the Qt libraries.
-
Download or clone the sources and then <code>configure -platform win32-g++-4.6</code> and <code>mingw32-make</code>.