Results 1 to 1 of 1

Thread: porting code from 4.8 to 5.1: No rule to make ui target

  1. #1
    Join Date
    Dec 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: porting code from 4.8 to 5.1: No rule to make ui target

    On Windows 7.

    Just installed Qt 5.1.1 and started recompiling my code.

    I don't use QtDesigner. I use my own ui.h file.

    Getting the following error:

    :-1: error: No rule to make target 'bits.ui', needed by 'ui_bits.h'. Stop.

    The ui header I use is named bits.ui.h, not ui_bits.h, which is what QtDesigner wants to use.
    This all worked fine with Qt 4.8.

    Here is my project file.

    Qt Code:
    1. QT += core gui
    2.  
    3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    4.  
    5. TARGET = bits
    6. TEMPLATE = app
    7.  
    8. SOURCES += main.cpp \
    9. hexedit.cpp \
    10. bits.cpp \
    11. bitfield.cpp \
    12. BitButton.cpp \
    13. shiftop.cpp \
    14. formatgroup.cpp
    15.  
    16. HEADERS += \
    17. controlgroup.h \
    18. bits.ui.h \
    19. bits.h \
    20. bitfield.h \
    21. BitButton.h \
    22. hexedit.h \
    23. shiftop.h \
    24. formatgroup.h
    25.  
    26. FORMS += \
    27. bits.ui
    To copy to clipboard, switch view to plain text mode 

    I tried removing the FORMS += bits.ui from the project, but the error persists.

    I'm certain it's an error on my part, but googling this error has been no help.

    On Windows 7.

    Just installed Qt 5.1.1 and started recompiling my code.

    I don't use QtDesigner. I use my own ui.h file.

    Getting the following error:

    :-1: error: No rule to make target 'bits.ui', needed by 'ui_bits.h'. Stop.

    The ui header I use is named bits.ui.h, not ui_bits.h, which is what QtDesigner wants to use.
    This all worked fine with Qt 4.8.

    Here is my project file.

    Qt Code:
    1. QT += core gui
    2.  
    3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    4.  
    5. TARGET = bits
    6. TEMPLATE = app
    7.  
    8. SOURCES += main.cpp \
    9. hexedit.cpp \
    10. bits.cpp \
    11. bitfield.cpp \
    12. BitButton.cpp \
    13. shiftop.cpp \
    14. formatgroup.cpp
    15.  
    16. HEADERS += \
    17. controlgroup.h \
    18. bits.ui.h \
    19. bits.h \
    20. bitfield.h \
    21. BitButton.h \
    22. hexedit.h \
    23. shiftop.h \
    24. formatgroup.h
    25.  
    26. FORMS += \
    27. bits.ui
    To copy to clipboard, switch view to plain text mode 

    I tried removing the FORMS += bits.ui from the project, but the error persists.

    I'm certain it's an error on my part, but googling this error has been no help.


    Added after 1 47 minutes:


    OK, I found the answer at this link.

    http://qt-project.org/forums/viewthread/26181

    The important part of the thread is this:

    Rerun qmake (Build->Run qmake), or, if that fails, clean the output directory and rebuild your project.
    Also make sure you have a QT += widgets in your .pro file. Qt5 moved widgets to separate library.

    I had done all the other stuff, so it was Build->Run qmake that did it for me.
    Last edited by MartinCook; 8th December 2013 at 01:11.

Similar Threads

  1. :-1: error: No rule to make target
    By quakig in forum Newbie
    Replies: 1
    Last Post: 8th December 2013, 01:16
  2. :: error: No rule to make target
    By kurrachow in forum Newbie
    Replies: 2
    Last Post: 15th March 2011, 14:33
  3. Replies: 1
    Last Post: 5th March 2011, 19:23
  4. No rule to make target
    By Coolname007 in forum Qt Programming
    Replies: 6
    Last Post: 4th March 2011, 21:08
  5. No rule to make target?
    By walsha3000 in forum Qt Programming
    Replies: 1
    Last Post: 2nd July 2010, 06:42

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.