[Qt-creator] No Empty Project
Christian Wansart
squall90 at gmx.net
Sat Nov 1 14:39:15 CET 2008
Markus Fischer schrieb:
> Hi,
>
> Is there a way to create an empty project file where I can add source and header files in my own fashion? Here is a little example for my problem:
>
> I chose a new Qt4 Console Application. I get a *.pro and a main.cpp file. This is the *.pro file:
>
>> #-------------------------------------------------
>> #
>> # Project created by QtCreator 2008-11-01T13:03:12
>> #
>> #-------------------------------------------------
>>
>> QT -= gui
>>
>> TARGET = viewdit_creator
>> CONFIG += console
>> CONFIG -= app_bundle
>>
>> TEMPLATE = app
>>
>>
>> SOURCES += main.cpp
>>
>
> Now, when I write the following code into the main.cpp it becomes uncompileable, because it cannot find the headerfile for QApplication.
>
>
>> #include <QApplication>
>>
>> int main(int argc, char *argv[])
>> {
>> QApplication app(argc, argv);
>> return app.exec();
>> }
>>
>
> But when I use the same main.cpp with a qmake created *.pro file it works fine:
>
>
>> ######################################################################
>> # Automatically generated by qmake (2.01a) Sa Nov 1 13:01:11 2008
>> ######################################################################
>>
>> TEMPLATE = app
>> TARGET =
>> DEPENDPATH += .
>> INCLUDEPATH += .
>>
>> # Input
>> SOURCES += main.cpp
>>
>
> Is there any way to generate the *.pro file like a simple 'qmake -project' would do?
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
>
Hi Markus,
it depends on what you want to do. If you want to write a GUI
application, why do you choose "console application"? Try GUI and it
will works or you just have to edit your .pro files:
> QT -= gui
> >
> > TARGET = viewdit_creator
> > CONFIG += console
> > CONFIG -= app_bundle
> >
> > TEMPLATE = app
> >
> >
> > SOURCES += main.cpp
As you can see on the first line it disables the gui, so you can't use.
On the fourth line it adds the console config. If you remove them, it
should work.
- Christian Wansart
More information about the Qt-creator-old
mailing list