Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. "Qt No rule to make target" i cannot find the error
Forum Updated to NodeBB v4.3 + New Features

"Qt No rule to make target" i cannot find the error

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 6.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Exotic_Devel
    wrote on last edited by
    #1

    When compiling my project I am getting the error:
    :-1: error: No rule to make target libgui.a', needed by libdataaccess.a'. Stop.

    I analyzed the files pro, but could not find the error.

    main pro file:

    @TEMPLATE = subdirs

    SUBDIRS +=
    TecTrackerAdm
    TecTrackerOpr
    Core

    OTHER_FILES += TecTracker.pri
    @

    Core.pro:

    @TEMPLATE = subdirs

    SUBDIRS +=
    dataaccess
    tests
    gui@

    dataaccess.pro:

    @#-------------------------------------------------

    Project created by QtCreator 2014-07-23T14:15:58

    #-------------------------------------------------

    QT += sql

    QT -= gui

    TARGET = dataaccess
    TEMPLATE = lib
    CONFIG += staticlib

    SOURCES += dataaccess.cpp

    HEADERS += dataaccess.hpp
    unix {
    target.path = /usr/lib
    INSTALLS += target
    }

    win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../gui/release/ -lgui
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../gui/debug/ -lgui
    else:unix: LIBS += -L$$OUT_PWD/../gui/ -lgui

    INCLUDEPATH += $$PWD/../gui
    DEPENDPATH += $$PWD/../gui

    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../gui/release/libgui.a
    else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../gui/debug/libgui.a
    else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../gui/release/gui.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../gui/debug/gui.lib
    else:unix: PRE_TARGETDEPS += $$OUT_PWD/../gui/libgui.a
    @

    gui.pro:

    @#-------------------------------------------------

    Project created by QtCreator 2014-09-02T13:39:00

    #-------------------------------------------------

    QT += widgets sql

    TARGET = gui
    TEMPLATE = lib
    CONFIG += staticlib

    SOURCES +=
    configconnec.cpp

    HEADERS +=
    configconnec.hpp
    unix {
    target.path = /usr/lib
    INSTALLS += target
    }

    FORMS += configconnec.ui

    copyuifile.commands = $(COPY_DIR) $$PWD/configconnec.ui $$OUT_PWD
    first.depends = $(first) copyuifile
    export(first.depends)
    export(copyuifile.commands)
    QMAKE_EXTRA_TARGETS += first copyuifile

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../DynamicQtWidgets/build/release/ -ldynamicqtwidgets
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../DynamicQtWidgets/build/debug/ -ldynamicqtwidgets
    else:unix: LIBS += -L$$PWD/../../../DynamicQtWidgets/build/ -ldynamicqtwidgets

    INCLUDEPATH += $$PWD/../../../DynamicQtWidgets/build
    DEPENDPATH += $$PWD/../../../DynamicQtWidgets/build
    @

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      I suspect that your build is not able to find PRE_TARGETDEPS += $$OUT_PWD/../gui/release/libgui.a. Just check this directory and library file.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Exotic_Devel
        wrote on last edited by
        #3

        'libgui.a' does not exist in the directory because it has not yet been compiled. The project must first compile 'gui.pro' and then compile 'dataaccess.pro'. I think the compilation is not happening in that order.

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Exotic_Devel
          wrote on last edited by
          #4

          It was how I imagined it was a matter of build order. I made changes to 'Core.pro'

          @TEMPLATE = subdirs

          SUBDIRS +=
          gui
          dataaccess
          tests

          CONFIG += ordered
          @

          The error stopped

          1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #5

            Try to change the order of build like following ?

            SUBDIRS +=
            gui
            tests
            dataaccess

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            1 Reply Last reply
            0
            • E Offline
              E Offline
              Exotic_Devel
              wrote on last edited by
              #6

              Yes, it was changed, as shown in my last reply here. Already working.

              Thank you for your help.

              [quote author="Dheerendra" date="1409799816"]Try to change the order of build like following ?

              SUBDIRS +=
              gui
              tests
              dataaccess[/quote]

              1 Reply Last reply
              0
              • dheerendraD Offline
                dheerendraD Offline
                dheerendra
                Qt Champions 2022
                wrote on last edited by
                #7

                my bad. I did not pay attention to your last line. Please move this issue to SOLVED state by changing the question to SOLVED state.

                Dheerendra
                @Community Service
                Certified Qt Specialist
                http://www.pthinks.com

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved