[solved] Windows application runs with console window

  • I write an application.

    The common definitions in the project file are:

    @TEMPLATE = app
    TARGET = application
    DESTDIR = ..
    QT += core gui network sql widgets
    CONFIG += windows@

    But when I run application I see the console (command prompt) window within my application. Why?

    I use Qt 5.1.0, MSVC 2012, Windows 7.

  • I have found the problem.

    In my project file there was such lines:

    @debug {
    QT += testlib

    When I've removed that lines command prompt window disappear.

    I've tried to change that lines to:

    @CONFIG(debug) {
    QT += testlib

    But it doesn't help me. What is the problem? Thanks.

  • I've found the solution. That is because in wrong CONFIG test.

    When I wrote:

    @CONFIG(debug, debug|release) {
    QT += testlib

    all become OK. Thanks.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Great you found out and shared ! Can you also update the thread title prepending [solved] so other forum users may know a solution has been found :)

    Happy coding !

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.