Results 1 to 17 of 17

Thread: Problem with a makefile

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Post Problem with a makefile

    I tried to run a project with 2 source files and a header file and there was some kind of problem with the linking (as the modules compile successfully separately). Moreover, the files were from a Qt tutorial so they should work...
    So I thought I'd create a makefile and then use make (btw i use mingw make). So eventually I created the makefile with qmake and then when I typed make in the command line I got this error message: "mingw32-make:*** No targets specified and no makefile found.Stop.". Then I tried make -f makefile and it said: "makefile:65:*** multiple target patterns. Stop.". And from this point on I didn't know what else to do.
    Other technical details: I use Windows XP, Qt 4.1, MinGW 5.0.2

    I will attach the makefile and maybe someone will spot the problem.
    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Problem with a makefile

    Your Makefile doesn't contain any rules that generate code --- your .pro file must be wrong. Could you post it?

  3. #3
    Join Date
    Feb 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with a makefile

    Yep sure. Here it is:
    Attached Files Attached Files

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Problem with a makefile

    Add "TEMPLATE = app", run "qmake QTapp.pro" and then make.

  5. #5
    Join Date
    Feb 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with a makefile

    I get the same error message....
    Could it be a problem with MinGW?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Problem with a makefile

    What files do you have in your project directory?

  7. #7
    Join Date
    Feb 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with a makefile

    The files in the project directory are: lcdrange.h, lcdrange.cpp and main.cpp.

  8. #8
    Join Date
    Feb 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with a makefile

    I eventually got to a more radical solution: I just deleted the lines in the makefile from line 65 to the end and it worked . But it's still kind of a mystery why it wouldn't work in the first place.

  9. #9
    Join Date
    Feb 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1

    Default Re: Problem with a makefile

    qmake generates paths that contain colons; Since microsoft operating systems have paths with the syntax drive:path the colon is interpreted by make as a separator instead of being part of the path.

    The problem is either in your version of make(because it doesn't interpret that colon as expected) or in qmake because it generates a bad Makefile.

    It's strange that you are using mingw which is said to be supported by open source Qt.

    Maybe you should try with make from MSYS but still I don't understand why it doesn't work with mingw32-make.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Problem with a makefile

    Quote Originally Posted by ovidiu.sabou
    Maybe you should try with make from MSYS but still I don't understand why it doesn't work with mingw32-make.
    There are some problems with MSYS. Anyway, Qt4 should work without any problems with MinGW and cmd.exe.

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Problem with a makefile

    Quote Originally Posted by Tweety
    The files in the project directory are: lcdrange.h, lcdrange.cpp and main.cpp.
    Where is the .pro file?

  12. #12
    Join Date
    Feb 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with a makefile

    Quote Originally Posted by jacek
    Where is the .pro file?
    The .pro file is in the exact same directory.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Problem with a makefile

    Quote Originally Posted by Tweety
    The .pro file is in the exact same directory.
    This is really strange. How do you invoke qmake? What is the current directory?

  14. #14
    Join Date
    Feb 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with a makefile

    I invoke qmake with "qmake -o Makefile QTapp.pro" in the directory where the .pro file is located.

Similar Threads

  1. makefile missing separator problem
    By terrywb in forum Installation and Deployment
    Replies: 4
    Last Post: 14th May 2009, 13:49
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. not able to change Makefile
    By shamik in forum Qt Programming
    Replies: 1
    Last Post: 9th June 2007, 12:00
  5. Replies: 5
    Last Post: 13th March 2006, 20:22

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
  •  
Qt is a trademark of The Qt Company.