Results 1 to 13 of 13

Thread: qmake using source files not in .pro file

  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 using source files not in .pro file

    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:

    Qt Code:
    1. ######################################################################
    2. # Automatically generated by qmake (2.01a) Do 9. Jul 14:51:28 2009
    3. ######################################################################
    4.  
    5. TEMPLATE = app
    6. TARGET =
    7. DEPENDPATH += .
    8. INCLUDEPATH += .
    9.  
    10. # Input
    11. SOURCES += helloWorld.cpp
    To copy to clipboard, switch view to plain text mode 

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

    Qt Code:
    1. #include <QApplication>
    2. #include <QLabel>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7. QLabel *label = new QLabel("Hello Qt!");
    8. label->show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    when running qmake MyHelloWorld.pro
    the result is:

    Qt Code:
    1. qmake MyHelloWorld.pro
    2. WARNING: Failure to find: ../HelloWorld/main.cpp
    3. WARNING: Failure to find: ../HelloWorld/hellowin.cpp
    4. WARNING: Failure to find: ../HelloWorld/hellounix.cpp
    5. WARNING: Failure to find: ../HelloWorld/hello.cpp
    6. WARNING: Failure to find: ../HelloWorld/hello.h
    7. WARNING: Failure to find: ../HelloWorld/main.cpp
    8. WARNING: Failure to find: ../HelloWorld/hellowin.cpp
    9. WARNING: Failure to find: ../HelloWorld/hellounix.cpp
    10. WARNING: Failure to find: ../HelloWorld/hello.cpp
    11. WARNING: Failure to find: ../HelloWorld/hello.h
    To copy to clipboard, switch view to plain text mode 

    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

  2. #2
    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 using source files not in .pro file

    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

  3. The following user says thank you to nish for this useful post:

    Asperamanca (9th July 2009)

  4. #3
    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 using source files not in .pro file

    Quote Originally Posted by MrDeath View Post
    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!

  5. #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 using source files not in .pro file

    Is there a kind of cache that I need to empty? Because those are source files from the previous project I tried to make.

  6. #5
    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 using source files not in .pro file

    have you posted the full pro file or part of it?

  7. #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 using source files not in .pro file

    That's the full file. It was auto-generated by qmake -project
    Something missing?

  8. #7
    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 using source files not in .pro file

    are you running qmake in the same directory as the pro file?

  9. #8
    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 using source files not in .pro file

    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

  10. #9
    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 using source files not in .pro file

    may be try to remove +=
    SOURCES += helloWorld.cpp
    to
    SOURCES = helloWorld.cpp
    HEADERS = dummy.h

  11. The following user says thank you to nish for this useful post:

    Asperamanca (9th July 2009)

  12. #10
    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 using source files not in .pro file

    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

  13. #11
    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 using source files not in .pro file

    Aaaahhh...now we're getting somewhere!

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

  14. #12
    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 using source files not in .pro file

    so did your problem solved? its strange..

  15. #13
    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 using source files not in .pro file

    Yep. That problem's solved. Now for the make...but I'll tinker around a bit before calling for help

Similar Threads

  1. Replies: 2
    Last Post: 28th June 2009, 13:39
  2. Generating .pro files from vcproj file or CMake file
    By ramazangirgin in forum Qt Programming
    Replies: 2
    Last Post: 17th February 2009, 10:37
  3. pass code from .pro file through to Makefile in qmake?
    By rholsen in forum Qt Programming
    Replies: 2
    Last Post: 16th October 2008, 19:51
  4. Replies: 3
    Last Post: 8th July 2008, 20:37
  5. need script to change qmake .pro file
    By rajeshs in forum Qt Programming
    Replies: 5
    Last Post: 7th July 2007, 18:53

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.