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. How can I tell qmake where the Qt libraries are?
Forum Updated to NodeBB v4.3 + New Features

How can I tell qmake where the Qt libraries are?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.9k 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.
  • W Offline
    W Offline
    Wunderwurzel
    wrote on last edited by
    #1

    I have a folder in my project directory which contains all the qt libraries that my qt application needs to link to. Now I want to persuade qmake to replace the line "-L/import/soft/dist/qt-lgpl/qt-5.2.0/x64-linux2.4-gcc45-gcc/lib", which is the default, with the project local directory, i.e. "-L../lib". How can this be done?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vezprog
      wrote on last edited by
      #2

      In your QMake properties, you need to use the following syntax:
      LIBS += -Lpathtoyourlib -lyourlibname

      Also, you can use INCLUDEPATH += to include and directories where headers may lie to link to your dlls.

      Deployment will be a little different though since it only knows to look in the path where your executable lives.

      In linux you will need to set or append to the environment variable LD_LIBRARY_PATH with the directory of your libs, that way when the application loads it knows to look for the dlls in the directory.

      In windows its PATH and QT_PLUGIN_PATH environment variables.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Wunderwurzel
        wrote on last edited by
        #3

        @dvez43
        The libraries in question are the Qt libraries. Qt5Core Qt5Network etc.
        So qmake will add the library path and library name to the linker command line. I can not control this via LIBS. There must be some variable that I can set that will tell qmake where I expect it to find Qt5Core etc.
        Something like QMAKE_LFLAGS_QT_DLL=../lib (which doesn'T work for me).

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          Hi,

          Why do you need to change the directory? Is this for building your program, or running it?

          When building, you should use your development libraries (from the place where you installed Qt). You shouldn't have any Qt libraries in your project directory.

          If you want to run your built program, see http://qt-project.org/doc/qt-5/linux-deployment.html

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          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