Use QHttpMultiPart impossible compile for WebAssembly(maybe bug)
-
if I use QHttpMultiPart the compiler throws an error:
In file included from ../../../Qt/5.15.2/wasm_32/include/QtNetwork/QHttpMultiPart:1:
../../../Qt/5.15.2/wasm_32/include/QtNetwork/qhttpmultipart.h:49:1: error: static_assert failed due to requirement 'bool(-1 == 1)' "Required feature http for file ../../../Qt/5.15.2/wasm_32/include/QtNetwork/qhttpmultipart.h not available."
QT_REQUIRE_CONFIG(http);
^~~~~~~~~~~~~~~~~~~~~~~
../../../Qt/5.15.2/wasm_32/include/QtCore/qglobal.h:87:36: note: expanded from macro 'QT_REQUIRE_CONFIG'
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " FILE " not available.")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../Qt/5.15.2/wasm_32/include/QtCore/qglobal.h:121:49: note: expanded from macro 'Q_STATIC_ASSERT_X'define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
^ ~~~~~~~~~~~~~~~
1 error generated.
I using QT version 5.15.2. And found in bugreport this error in past - https://bugreports.qt.io/browse/QTBUG-81501 and this bug fixed.
Why am I getting this error? -
Because the change that adds multipart support for wasm, 6b171dc6c0c0f0a822b212df77b58b28bd92716c, is not in 5.15.x, but will be part of Qt 6 webassembly.
That said, that patch would probably apply fairly cleanly to 5.15 if you want to to recompile Qt.