Unsolved windeployqt - Able to see console while running the application
-
I have deployed (release mode) my application using windeployqt tool. When I run the exe i am able to see the console logs which i don't want to. How to solve this issue?
-
remove "CONFIG += console" from your .pro file
-
@Tim.Jenssen I am not using that in the .pro file. Still I am able to see the consolwwhile running the standalone application.
-
Hi,
How did you configure your application ?
How are you doing logging in it ?
What version of Qt are you using ?
What version of Windows are you running ? -
@SGaist Logging using console.log
Qt creator version : 4.7.2
Qt version: 5.11.1
windows 10 -
You are doing the logging from QML. You can disable the console.log using the following environment variable. Do the following. It will disable the logging.
QT_LOGGING_RULES = qml=false -
@dheerendra Where should I set this environmental variable. In .pro file or anywhere else?
-
@dheerendra said in windeployqt - Able to see console while running the application:
QT_LOGGING_RULES
Set in the build environment of Qt Creator. Click on the projects on the left side bar. Select the appropriate kit. Go to Run settings. You will see vars like QTDIR, LOGNAME etc. Set the logging rule here.
-
@dheerendra Variable:QT_LOGGING_RULES
Value:qml=false
Am I right? -
Yes. It is right
-
@dheerendra I tried setting the environmental variable, but still getting the console log along with the standalone application deployed using windeployqt tool.
-
@Sandhiya
did you do a complete rebuild? Delete the build folder orclean
andrerun qmake
if you add
DEFINES += QT_NO_DEBUG_OUTPUT
inside your profile it will disable qDebug() outputs, I'm however not sure if this also effects QML.
-
@J.Hilk Yeah tried complete rebuild.Still the same.
DEFINES += QT_NO_DEBUG_OUTPUT has no effect on QML.Tried that one too -
![alt text]( image url)
-
@dheerendra I tried the same as mentioned in the above image. Still the same behavior.
-
Did you run qmake once after setting this parameter ?
-
@dheerendra Yes I did.
-
Able to figure out where exactly the problem is. The problem occurs because of adding
QT += qmltest
in .pro file. If I remove the above statement and try to build a standalone exe using windeployqt tool , only the application is getting launched without any console.
Can anyone help in solving this problem without commenting qmltest? -
@Sandhiya said in windeployqt - Able to see console while running the application:
Can anyone help in solving this problem without commenting qmltest?
why do you need this option when building a release application in the first place?
-
@raven-worx It's not needed. But when I try building the application in release mode /debug mode that flag by default will be there as part of my .pro file. Is there any way that can be ignored while build a release application?