QProcess Compile Error with Visual Studio 2012
-
When attempting to compile my application I get an error in Windows 7 with VS2012 whereas QProcess is not defined. I traced it down to the define QT_NO_PROCESS found in qprocess.h. But when I try a simple main.cpp program with the following main.pro:
CONFIG += qt
QT += core widgets
SOURCES = main.cppit compliles and links fine. When I use the exact main.pro specification with the exception of additional .cpp and .h files I encounter the problem.
I suspect qmake is finding something in one of my several headers or source files which causes QT_NO_PROCESS to be defined.
-
Remove:
@
CONFIG += qt
@Add:
@
QT += core gui widgets
@Have you compiled Qt yourself? Where and how does the compilation fail?
-
I tried your suggested changes to the main.pro but same error occurs. I am using a prebuilt Qt distribution for Windows provided by my company IT department. BTW - this application compiles and links fine in Linux.
Here is a snippet from the compiler error:
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\nmake.exe" -f Makefile.Release cl -c -nologo -Zm200 -O2 -MD -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWINRT -DQT_LARGEFILE_SUPPORT -DQ_BYTE_ORDER=Q_LITTLE_ENDIAN -DQT_NO_PRINTER -DQT_NO_PRINTDIALOG -DWINAPI_FAMILY=WINAPI_FAMILY_APP -DX64 -D__X64__ -D__x64__ -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DNDEBUG -I"..\..\include" -I"..\..\..\..\Qt\Qt5.2.0\5.2.0\msvc2012_64\include" -I"..\..\..\..\Qt\Qt5.2.0\5.2.0\msvc2012_64\include\QtWidgets" -I"..\..\..\..\Qt\Qt5.2.0\5.2.0\msvc2012_64\include\QtGui" -I"..\..\..\..\Qt\Qt5.2.0\5.2.0\msvc2012_64\include\QtANGLE" -I"..\..\..\..\Qt\Qt5.2.0\5.2.0\msvc2012_64\include\QtCore" -I"release" -I"..\..\..\..\Qt\Qt5.2.0\5.2.0\msvc2012_64\mkspecs\winrt-x64-msvc2012" -Forelease\ @C:\Users\gjv6417\AppData\Local\Temp\nm30F3.tmp
mainwindow.cpp
.\mainwindow.cpp(261) : error C2514: 'QProcess' : class has no constructorsAs I mentioned in my previous post, QT_NO_PROCESS does not get defined in Windows. My simple example works fine but the more complicated application which includes a wide-range of Qt classes does not.
I did a detailed analysis of the compile arguments from both my simple program and the more complicated one and there are differences. That's why I maintain, something I am using or including in the complicated application is tripping up defining QT_NO_PROCESS.
Thanks for your help.