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. Compiler can't find the library.
Forum Updated to NodeBB v4.3 + New Features

Compiler can't find the library.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 299 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.
  • L Offline
    L Offline
    Loc888
    wrote on last edited by Loc888
    #1

    I compiled one library, i put the .a files into libs, i also add the includes to correct folder.

    Then i start a new project, include the stuff into it, then add any random function from the library, and of course it doesn't work. I also follow few tutorials on youtube, and there it does work. What is wrong? There is no error what so ever, just "Undefined reference to" and the function name. The functions are available, also the header files are accessible.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Did you also add something like
      LIBS += -L$$PWD/build-MyLibrary/ -lmylibrary

      to the .pro file to link to your lib ?

      L 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        Did you also add something like
        LIBS += -L$$PWD/build-MyLibrary/ -lmylibrary

        to the .pro file to link to your lib ?

        L Offline
        L Offline
        Loc888
        wrote on last edited by
        #3

        @mrjj No, no one said i should do it, from what i can see, they just put the libs and includes, and that's it.

        mrjjM 1 Reply Last reply
        0
        • L Loc888

          @mrjj No, no one said i should do it, from what i can see, they just put the libs and includes, and that's it.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Loc888
          Hi
          Im not sure why it was not mentioned to link to your new lib.

          But the error "Undefined reference to" suggest that is needed.

          https://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application

          1 Reply Last reply
          2

          • Login

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