I have run into another in a long stream of obstacles attempting to build Qt5 with the VS2012 compiler.
When ICU is enabled ("-icu" on the configure command line, along with a proper 32-bit build of ICU in VS2012 and proper inclusion of all ICU paths (header, .lib, and .dll)), Line 688 of qtbase\src\corelib\codecs\qtextcodec.cpp
returns a NULL codec (ICU fails to return a codec) when asked for a codec whose name is "US-ASCII".
Specifically:
QTextCodec* QTextCodec::codecForLocale()
{
QCoreGlobalData *globalData = QCoreGlobalData::instance();
if (!globalData)
return 0;
QTextCodec *codec = globalData->codecForLocale.loadAcquire();
if (!codec) {
#ifdef QT_USE_ICU
// THIS BLOCK IS REACHED WHEN ICU IS ENABLED
textCodecsMutex()->lock();
// ***
// The following codec returned is NULL!!!
// (Internally, it sets the codec name to "US-ASCII",
// and fails to find a codec with this name)
// ***
codec = QIcuCodec::defaultCodecUnlocked();
textCodecsMutex()->unlock();
#else
// setupLocaleMapper locks as necessary
codec = setupLocaleMapper();
#endif
}
return codec;
}
Later, the NULL codec variable noted above is dereferenced (in the code for the "lrelease.exe" utility), and when the "lrelease.exe" utility runs as part of the Qt5 build process and attempts to perform a translation, it crashes due to this NULL dereference and causes the Qt build to stop with an error.
Stepping into the above QIcuCodec::defaultCodecUnlocked()
function reveals that the codec name is being set to US-ASCII
, and that a codec with this name is not found.
It therefore seems to be impossible to include ICU support with a VS2012-compiler 32-bit build of Qt5.
Worse, because Webkit
depends on ICU within Qt5, this means that Webkit
cannot be built, either.
Can someone please tell me if this is reasonably likely to be a bug with Qt5 with VS2012, or is there something I am not setting up properly in my build environment?
Of use, also, would be knowing whether anybody has been able to build Qt5 with the VS2012 compiler with ICU support enabled.
I have also posted a comment in a relevant, ongoing thread in the Qt forum.