November 12, 2010

kotaidis kotaidis
Lab Rat
1 posts

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” ); mw->show(); a.connect( &a, SIGNAL), &a, SLOT) ); 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?

Thanks!

2 replies

November 12, 2010

Franzk Franzk
Lab Rat
830 posts

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

.pro:

  1. CONFIG-=console

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

 Signature 

“Horse sense is the thing a horse has which keeps it from betting on people.”—W.C. Fields

http://www.catb.org/~esr/faqs/smart-questions.html

November 12, 2010

Deleted Member # 4a2 Deleted Member # 4a2
Ant Farmer
1481 posts

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

 
  ‹‹ QTableWidget - how to delete a row?      JObs with QMdiSubWindow! ››

You must log in to post a reply. Not a member yet? Register here!