Solved Remove console
-
Hi,
I am building a Qt application In Windows using VisualStudio 2013, Qt 5.3 and CMake. In release mode I wish to hide the console Window. What is the right way to do that.
I have checked different options, One was to change "main" to "WinMain" and change the subsystem to "Windows" from "Console". But the samples in Qt uses main, and i believe main is the right entry point to use.
What is the correct way?
Thanks a lot in Advance,
Lloyd -
Is your application a console application or a widget application?
If it is a widget application then remove CONFIG += console in your PRO file. -
Its a Widget application.
What I understood from your reply is to remove the subsystem "CONSOLE". Then it will throw an error unresolved external symbol "WinMain" as "main" is my entry point!
If I write WinMain the code won't be portable!
-
Hi,
IIRC, you need add
set(GUI_TYPE WIN32)
to your pro file.Hope it helps
-
In cmake file i was using
ADD_EXECUTABLE(MyExec ${MYEXEC_SRC} )
The problem is solved when I changed it to
ADD_EXECUTABLE(MyExec WIN32 ${MYEXEC_SRC} )
-
This post is deleted! -
@lloydqt
Use the Topic Tools button to mark as Solved.