Can I use MSVC compiler instead of MinGW for Webassembly?
-
wrote on 9 Jul 2022, 19:54 last edited by
Hello,
Does the latest versions Qt (Qt 6 and above) support MSVC complier as well apart from MinGW for Qt Webassembly?
Currently, I am using Qt 5.12.3 and MSVC2017 compiler for our product. I want to move our product into web as well but I want to use MSVC compiler only for our development. I do not want to use MinGW compiler.
Is there any option in latest releases so that I could go ahead with Qt and MSVC compiler for Qt Webassesbly ? Kindly suggest asap.
Thanks & Regards,
Pradson -
Hello,
Does the latest versions Qt (Qt 6 and above) support MSVC complier as well apart from MinGW for Qt Webassembly?
Currently, I am using Qt 5.12.3 and MSVC2017 compiler for our product. I want to move our product into web as well but I want to use MSVC compiler only for our development. I do not want to use MinGW compiler.
Is there any option in latest releases so that I could go ahead with Qt and MSVC compiler for Qt Webassesbly ? Kindly suggest asap.
Thanks & Regards,
Pradson@Pradson said in Can I use MSVC compiler instead of MinGW for Webassembly?:
Does the latest versions Qt (Qt 6 and above) support MSVC complier as well apart from MinGW for Qt Webassembly?
Qt for WebAssembly does not use MSVC OR MinGW. Instead, you need the emscripten compiler: https://doc.qt.io/qt-6/wasm.html#installing-emscripten
-
@Pradson said in Can I use MSVC compiler instead of MinGW for Webassembly?:
Does the latest versions Qt (Qt 6 and above) support MSVC complier as well apart from MinGW for Qt Webassembly?
Qt for WebAssembly does not use MSVC OR MinGW. Instead, you need the emscripten compiler: https://doc.qt.io/qt-6/wasm.html#installing-emscripten
wrote on 10 Jul 2022, 07:58 last edited byThanks for the reply.
Kindly check the below motioned information into the the link that you have provided. It seems the MinGW is required for the webassembly. Kindly check and suggest.
"On Windows, make sure you have MinGW in your PATH and configure with the following:"
Thanks & Regards,
Pradson -
Thanks for the reply.
Kindly check the below motioned information into the the link that you have provided. It seems the MinGW is required for the webassembly. Kindly check and suggest.
"On Windows, make sure you have MinGW in your PATH and configure with the following:"
Thanks & Regards,
Pradsonwrote on 10 Jul 2022, 08:12 last edited by@Pradson
The reference toMinGW
is in the section Building Qt from Source. Since it states above that binary builds are available for platforms, why are you wanting to build it? -
wrote on 10 Jul 2022, 09:01 last edited by lorn.potter 7 Oct 2022, 09:03
The requirement for mingw on windows was because Emscripten needed mingw-make to build, and is still needed for Qt 5, as Emscripten does not understand nmake, which is related to argument switches that nmake uses.
The documentation needs to be updated for Qt 6.
If you using Qt 6, the msvc Qt binaries can be used for the host build if you have ninja. Ninja can be used for building both Qt itself and apps. Specifying -cmake-use-default-generator when building Qt and trying to use (msvc) nmake will not work.
Ninja can create proper makefiles, otherwise mingw-make will be needed.
-
@Pradson
The reference toMinGW
is in the section Building Qt from Source. Since it states above that binary builds are available for platforms, why are you wanting to build it? -
The requirement for mingw on windows was because Emscripten needed mingw-make to build, and is still needed for Qt 5, as Emscripten does not understand nmake, which is related to argument switches that nmake uses.
The documentation needs to be updated for Qt 6.
If you using Qt 6, the msvc Qt binaries can be used for the host build if you have ninja. Ninja can be used for building both Qt itself and apps. Specifying -cmake-use-default-generator when building Qt and trying to use (msvc) nmake will not work.
Ninja can create proper makefiles, otherwise mingw-make will be needed.
wrote on 10 Jul 2022, 18:07 last edited by@lorn-potter
Hi, thanks a lot for sharing me detailed description.
Currently, I am using Qt 5.12.3 and MSVC2017 for our product. If I migrated entire code from Qt 5.12.3 and MSVC2017 to Qt 6 and MSVC2019 then, could I replace MinGW with MSVC 2019 for web assembly related development? If yes, please share the steps for the same and if not, then suggest any other options.
If I am in wrong path, then please suggest how shall I approach for our solution as well?
Thanks,
Pradson
1/7