Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED]Add external library relative to project
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Add external library relative to project

Scheduled Pinned Locked Moved Qt Creator and other tools
4 Posts 2 Posters 1.8k 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.
  • J Offline
    J Offline
    Jake007
    wrote on last edited by
    #1

    Hi!

    I'd like to add external library to project. Both projects are at the same depth on disk.

    Example:

    • D:\Projects\Library\
    • D:\Projects\Program\

    Program depends on Library. When library is nested in a project, I'd use
    @LIBS += "$$PRO_FILE_PWD/path/to/project/libFile.a"@

    How can I do this (relative) in upper example? If I use "..", paths are not resolved correctly.
    I took a look at the examples on the bottom of "this":http://doc.qt.digia.com/qtcreator-2.2/creator-project-qmake-libraries.html text here, but none worked.

    Regards,
    Jake


    Code is poetry

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      This is strange. DotDot should work. You should use full -L<lib path> -l<libname> notation, though.

      Feel free to take my "Qes project":https://github.com/sierdzio/qeasyshell/blob/master/examples/asynchronous/asynchronous.pro as another working example. Also, you have to remember that Qt Creator likes shadow builds right now. The path has to be valid relative to the build directory (or, a better idea in fact is to disable shadow building).

      (Z(:^

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jake007
        wrote on last edited by
        #3

        Hi!

        I took a look at your project and combined a few things.
        I also managed to get DotDot working.

        @LIBS += "$$PWD/../path/to/library.a"@

        Thanks!

        Regards,
        Jake


        Code is poetry

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          I'm happy to hear that. Happy coding :)

          (Z(:^

          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