Results 1 to 7 of 7

Thread: qmake odditiy - Bug reports?

  1. #1
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default qmake odditiy - Bug reports?

    As noted in this thread yesterday, I see an odd behaviour of qmake:
    SOURCE and HEADER variables (and possibly others, too) seem to remember the values of past executions of qmake.
    So if I only use SOURCE += ... (as seen in many tutorials), I'll inevitably run into troubles because there's some leftover references in the variables.

    1st question: Is this behaviour as it should be? Or would you see that as a bug?
    2nd question: If bug, where do I report it?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake odditiy - Bug reports?

    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?
    Last edited by wysota; 10th July 2009 at 09:49. Reason: spelling error
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qmake odditiy - Bug reports?

    1. I did not faced this issue on my machine.
    2. u can report the bug by eamil to trolltech... search for their task tracker on qtsoftware.com
    Last edited by nish; 10th July 2009 at 09:52. Reason: changed "my email" to "by email"

  4. #4
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: qmake odditiy - Bug reports?

    Quote Originally Posted by wysota View Post
    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:

    Qt Code:
    1. HEADERS += \
    2. mouse.h
    3. SOURCES += \
    4. main.cpp \
    5. mouse.cpp
    6.  
    7. RESOURCES += \
    8. mice.qrc
    9.  
    10. # install
    11. target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
    12. sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS collidingmice.pro images
    13. sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
    14. 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:

    Qt Code:
    1. WARNING: Failure to find: d:/Projects/QT/HelloWorld/main.cpp
    2. WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellowin.cpp
    3. WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellounix.cpp
    4. WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.cpp
    5. WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.h
    6. WARNING: Failure to find: d:/Projects/QT/HelloWorld/main.cpp
    7. WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellowin.cpp
    8. WARNING: Failure to find: d:/Projects/QT/HelloWorld/hellounix.cpp
    9. WARNING: Failure to find: d:/Projects/QT/HelloWorld/hello.cpp
    10. 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?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake odditiy - Bug reports?

    Quote Originally Posted by Asperamanca View Post
    And I think I've found it. They are in my qconfig.pri. Removed them and everything works. No idea how they got there.
    Someone must have placed them there, either you or some IDE you've been using.

    So much for "impossible"
    It's not a qmake bug, so it's impossible that it's a qmake bug. Blame yourself before blaming others for things that do not work.

    Can someone tell me where I can find more info about qconfig.pri?
    There is no special info about this file. This is a standard file that gets included into every project qmake operates on like a bunch of other files in mkspecs directory.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: qmake odditiy - Bug reports?

    This is pure semantics, but I stated

    Quote Originally Posted by Asperamanca View Post
    SOURCE and HEADER variables (and possibly others, too) seem to remember the values of past executions of qmake.
    (there was more, but this is the core of the statement)

    ...to which you replied...

    Quote Originally Posted by wysota View Post
    No, that's impossible
    If (as I now know) there is a mechanism to pre-define those values for all projects (using qconfig.pri), then my statement is basically correct: The value of the SOURCES variable can be remembered across multiple project, machine reboots, etc.
    Of course the description is misleading, since I did not (at that time) know the cause for this behaviour, and thus used the term "remembering", which is inaccurate.

    Please consider also that I did not plainly say this is a bug, instead I asked whether this would be considered a bug, or expected behaviour (which, as it turns out, it is).

    No blame was assigned to anyone, and I probably will not be able to find out how exactly the filenames ended up in qconfig.pri (I only know for sure that I never manually wrote anything in there).

    EDIT:
    As for IDE...I'm using QTCreator, which (right now) seems to be the most likely cause.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake odditiy - Bug reports?

    Quote Originally Posted by Asperamanca View Post
    This is pure semantics, but I stated


    (there was more, but this is the core of the statement)
    Which is false. Prior executions of qmake have nothing to do with contents of one of included files. It's not qmake that made changes to those files, it only modifies Makefiles (and creates a .pro file when run with -project switch).

    If (as I now know) there is a mechanism to pre-define those values for all projects (using qconfig.pri), then my statement is basically correct: The value of the SOURCES variable can be remembered across multiple project, machine reboots, etc.
    Which, again, has nothing to do with prior executions which was the essence of your statement. You can modify qconfig.pri (or any other included file) and run qmake once and it will "remember (nonexisting) prior executions".


    Of course the description is misleading, since I did not (at that time) know the cause for this behaviour, and thus used the term "remembering", which is inaccurate.
    On the other hand my "impossible" statement was accurate because the only file opened in write mode by qmake is the Makefile. It doesn't do any caching on its own.

    EDIT:
    As for IDE...I'm using QTCreator, which (right now) seems to be the most likely cause.
    I think so as well, Creator likes to modify wrong project files when you add a file to a project. If you had Qt opened as a project and config.pri was mentioned there somewhere explicitely and you tried adding a file to some project, it might have accidently landed in qconfig.pri. That's a bug in Creator, for sure
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. qmake sux a lot
    By singermornings in forum Qt Programming
    Replies: 6
    Last Post: 29th January 2009, 08:33
  2. Qt 4.3.1 & MinGW 5.1.3 & MSYS 1.0 qmake problem
    By mdecandia in forum Installation and Deployment
    Replies: 2
    Last Post: 2nd October 2008, 16:52
  3. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  4. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.