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. "No rule to make target" error, when adding an external library to Qt Widget project.
Forum Updated to NodeBB v4.3 + New Features

"No rule to make target" error, when adding an external library to Qt Widget project.

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.1k 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.
  • T Offline
    T Offline
    tabakerkaaaa
    wrote on last edited by
    #1

    Hello, i have a problem with adding an external library, called "libpng". I tried to change *.pro in different ways. First of all i tried adding those lines of code:

    INCLUDEPATH += $usr/local/libpng/include
    LIBS += -L$usr/local/libpng/lib -lpng
    

    This is a default folder of libraries. It didn't work. After i downloaded all the files of "libpng" library manually and added those lines of code:

    INCLUDEPATH += $usr/Qt/bin/headers
    LIBS += $usr/Qt/bin/lib/libpng.lib -lpng
    

    But there still was an error like this:
    'png.h' file not found
    #include "png.h"

    Later i found out that i can add an external library via Qt Creator menu. I did it, so now i have this error:

    :-1: Error: No rule to make target /Users/nikitababenko/CProjects/coursework2/bin/lib/liblibpng.a', needed by coursework2.app/Contents/MacOS/coursework2'. Stop.

    Can anyone help me? Thanks everyone in advance. If you would need anything else from me, i would be glad to assist.

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @tabakerkaaaa said in "No rule to make target" error, when adding an external library to Qt Widget project.:

      $usr

      really $usr and not /usr? What OS are you using?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      T 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        @tabakerkaaaa said in "No rule to make target" error, when adding an external library to Qt Widget project.:

        $usr

        really $usr and not /usr? What OS are you using?

        T Offline
        T Offline
        tabakerkaaaa
        wrote on last edited by
        #3

        @Christian-Ehrlicher I use Mac OS and don't really know which one is correct. Found this solution somewhere on stackoverflow.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          Where exactly are these files located on your system ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          T 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            Where exactly are these files located on your system ?

            T Offline
            T Offline
            tabakerkaaaa
            wrote on last edited by
            #5

            @SGaist Hello, files, which were downloaded manually are located in /Qt/bin/
            libpng, which was downloaded via cmd, is located in /usr/local/lib

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Then that's the path you should be using: -L/usr/local/lib or the subdirectory matching where the library is located.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              T 1 Reply Last reply
              3
              • SGaistS SGaist

                Then that's the path you should be using: -L/usr/local/lib or the subdirectory matching where the library is located.

                T Offline
                T Offline
                tabakerkaaaa
                wrote on last edited by
                #7

                @SGaist Wow, i feel so dumb now, i spend the whole day trying to connect it, and the solution is so simple. Thank you very much!

                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