
Originally Posted by
wysota
No, that's impossible, I assure you. I'm always using "SOURCES+=" and it works fine. And it is SOURCES, not SOURCE. You must have an error somewhere in your project. Can you tell us step by step how to reproduce this "bug" starting with an empty project?
After 10 years as software developer, the word "impossible" is no longer in my vocabulary.
Consider the following .pro file:
HEADERS += \
mouse.h
SOURCES += \
main.cpp \
mouse.cpp
RESOURCES += \
mice.qrc
# install
target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS collidingmice.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
INSTALLS += target sources
HEADERS += \
mouse.h
SOURCES += \
main.cpp \
mouse.cpp
RESOURCES += \
mice.qrc
# install
target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS collidingmice.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
INSTALLS += target sources
To copy to clipboard, switch view to plain text mode
(which is from one of the samples of the QT SDK)
Now consider the error output upon calling qmake with that file:
WARNING: Failure to find: d:/Projects/QT/HelloWorld/main.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellowin.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellounix.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.h
WARNING: Failure to find: d:/Projects/QT/HelloWorld/main.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellowin.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellounix.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.h
WARNING: Failure to find: d:/Projects/QT/HelloWorld/main.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellowin.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellounix.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.h
WARNING: Failure to find: d:/Projects/QT/HelloWorld/main.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellowin.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellounix.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.cpp
WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.h
To copy to clipboard, switch view to plain text mode
Consider also that this goes away if I replace the first "+=" with a simple "=".
Sounds like a caching problem to me...
***** LONG STORY - SKIP IF YOU WANT ******
I should note that I first tried to run projects directly from QTCreator. The files mentioned in the warnings are from the qmake-tutorial, also in the samples of the SDK. As far as I remember, this was the last project I had open in my QTCreator.
After I realized I could run the samples directly from QTCreator, but could not generate executables, I closed QTCreator, and tried to build a simple project using qmake and make.
First I copied the sample from examples\qmake\tutorial, tried to build it, and got stuck somewhere.
i found an even easier sample in an online book, cleaned out the folder, and started anew, creating only a single source file this time, then a .pro file (using qmake).
When trying to build the .pro file using qmake, the trouble started (as noted in the thread linked above).
I've since tried to run a different sample from QTCreator - that works, but does not change the error output when trying to build the .pro file with SOURCE += ...
Somehow, the files from the first project I actually tried to build from the command line seem stuck...permanently.
***** END LONG STORY *****
Since it even survives machine restarts, it must be on the HD somewhere.
And I think I've found it. They are in my qconfig.pri. Removed them and everything works. No idea how they got there.
So much for "impossible"
Can someone tell me where I can find more info about qconfig.pri?
Bookmarks