PDA

View Full Version : qmake using source files not in .pro file



Asperamanca
9th July 2009, 14:47
I'm running QT 4.5.2 on Windows XP

I'm trying to make a simple HelloWorld application, but have run into a puzzling problem with qmake.

My .pro file (MyHelloWorld.pro) looks thus:


################################################## ####################
# Automatically generated by qmake (2.01a) Do 9. Jul 14:51:28 2009
################################################## ####################

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .

# Input
SOURCES += helloWorld.cpp


My only source file (helloWorld.cpp) looks thus:


#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}

when running qmake MyHelloWorld.pro
the result is:


qmake MyHelloWorld.pro
WARNING: Failure to find: ../HelloWorld/main.cpp
WARNING: Failure to find: ../HelloWorld/hellowin.cpp
WARNING: Failure to find: ../HelloWorld/hellounix.cpp
WARNING: Failure to find: ../HelloWorld/hello.cpp
WARNING: Failure to find: ../HelloWorld/hello.h
WARNING: Failure to find: ../HelloWorld/main.cpp
WARNING: Failure to find: ../HelloWorld/hellowin.cpp
WARNING: Failure to find: ../HelloWorld/hellounix.cpp
WARNING: Failure to find: ../HelloWorld/hello.cpp
WARNING: Failure to find: ../HelloWorld/hello.h

Where do all those files come from? They're certainly not mentioned in the .pro file.

Any hints? Also: Any links to tutorials that actually explain the build process (not only the parameters of qmake) would be greatly appreciated!

Robert

nish
9th July 2009, 14:56
first try to give
TARGET = myhello

and see if the errors go away..
next read this http://doc.trolltech.com/4.5/qmake-manual.html

Asperamanca
9th July 2009, 15:00
first try to give
TARGET = myhello

and see if the errors go away..
next read this http://doc.trolltech.com/4.5/qmake-manual.html

Thanks. Error does not go away, but I'll see if I can finds something in the manual. Quicker fixes still welcome!

Asperamanca
9th July 2009, 15:01
Is there a kind of cache that I need to empty? Because those are source files from the previous project I tried to make.

nish
9th July 2009, 15:04
have you posted the full pro file or part of it?

Asperamanca
9th July 2009, 15:07
That's the full file. It was auto-generated by qmake -project
Something missing?

nish
9th July 2009, 15:13
are you running qmake in the same directory as the pro file?

Asperamanca
9th July 2009, 15:17
Yes. My command line is in the directory with the aforementioned .pro file, and I type "qmake MyHelloWorld.pro"

BTW, the only QT-related entry in my PATH env-var is the [...]\qt\bin\ folder

nish
9th July 2009, 15:20
may be try to remove +=
SOURCES += helloWorld.cpp
to
SOURCES = helloWorld.cpp
HEADERS = dummy.h

nish
9th July 2009, 15:20
may be try to remove +=
SOURCES += helloWorld.cpp
to
SOURCES = helloWorld.cpp
HEADERS = dummy.h

edit:
also try to rename the folder, pro file to helloWorld

Asperamanca
9th July 2009, 15:24
Aaaahhh...now we're getting somewhere!

Does qmake retains the variables last used? Even when re-booting the machine (which I did several times)?

nish
9th July 2009, 15:25
so did your problem solved? its strange..

Asperamanca
9th July 2009, 15:29
Yep. That problem's solved. Now for the make...but I'll tinker around a bit before calling for help ;)