Unsolved QProcess with Qt5.9 and MVSC2017
-
Hi All,
I just re-installed Qt to get version 5.9.
I'm trying to compile a program that uses QProcess(es).
I get a compilation error "processenvironment" not available (both for 32 bits and 64 bits).
When I compile my program with mingw, everything works fine.
I was not able to find any documentation on this issue.
Any idea where the problem comes from?
Antoine -
@Antoine-Rauzy Can you post the whole error message?
-
I'm getting exactly the same thing in VS2017. Compiling any file that includes
<QProcess>
results in an error messageerror C2338: Required feature processenvironment for file d:\development\qt\5.9\winrt_x64_msvc2017\include\qtcore\qprocess.h not available.
This error message is actually generated by
QT_REQUIRE_CONFIG
(static_assert
in disguise) inqprocess.h
, which checksQT_REQUIRE_CONFIG(processenvironment);
which in turn requires existence of
QT_FEATURE_processenvironment
inQtCore\qconfig.h
. However, myqconfig.h
does not defineQT_FEATURE_processenvironment
.What do we need to do to make it appear?
-
@AndreyT You are building for WinRT. Is this on purpose?
-
Check out Qt's doc...
Note: QProcess is not supported on VxWorks, iOS, tvOS, watchOS, or the Universal Windows Platform. -
That's right. The Universal Windows Platform is not supported.
But in previous version of Qt and MSVC, it was.
So the question is where this regression comes from and more importantly, does it mean that QProcess(es) won't be supported in any subsequent versions of Qt and/or MSVC? -
@jsulm said in QProcess with Qt5.9 and MVSC2017:
@AndreyT You are building for WinRT. Is this on purpose?
Realized my mistake, thank you. Apparently I installed wrong platform/version of Qt.
-
@Antoine-Rauzy That's the point: UWP is not the same thing as MSVC although they use the same IDE, it's not the same platform.
So to sum up:
- QProcess works on Windows like it always did when building for the Windows platform be it with MSVC or MinGW.
- QProcess is not available on UWP because the WinRT platform doesn't support that concept, it has nothing to do with Qt.
-
@SGaist Thank you so much for these explanations.
I have an additional naive question:
Why the configuration kit manager does not propose a default configuration to compile the Qt project with MSVC but without targeting UWP?
It is not at all obvious that such a possibility exists. -
Because you are using a Qt version built for UWP. If you want to target standard Windows, you have to use the classic Qt for MSVC.
Again, that's nothing Qt specific, the two platforms are different so they have different requirements and you can't just switch compilers.