Using a user-built lib in application opens also a cmd window. Why?

  • Hello everyone,

    I have build a static lib (applicationLib.h and applicationLib.lib).

    Now, I am using this lib in another Qt application.
    The code is simple:

    #include <qapplication.h>
    #include "applicationLib.h"

    int main( int argc, char ** argv )
    QApplication a( argc, argv );
    ApplicationLib *mw = new ApplicationLib();
    mw->setCaption( "Qt Example - Application" );
    a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
    return a.exec();

    When starting, the correct GUI shows, but additionally (actually before the GUI appears) a cmd window opens.
    How can I get rid of it?


  • Tell visual studio or your qmake that you don't want to have a console app.


    /SUBSYSTEM:CONSOLE is enabled by something in your linker flags. Make sure it ends up with only /SUBSYSTEM:WINDOWS

  • hi kotaidis, can you enclose your code within the @ tag for better reading

Log in to reply

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