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. Qt Creator locating dynamic libraries
Forum Updated to NodeBB v4.3 + New Features

Qt Creator locating dynamic libraries

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 4 Posters 13.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.
  • L Offline
    L Offline
    ludde
    wrote on last edited by
    #1

    On Windows, Qt Creator seems to have some way of automatically locating dynamic libraries, so that they are found when a built application is run. Because in some situations it manages to run applications I build without any need for me to move or include DLLs in the path. However, for some weird reason it does not work if I use e.g. the full win32-msvc2008 mkspec to add the library path:

    @win32-msvc2008:LIBS += /my/lib/path@

    But it works if I do:

    @win32:LIBS += /my/lib/path@

    Or just:

    @LIBS += /my/lib/path@

    Has anyone else seen this, and can anyone think of what is going on and why?
    (On Linux, I have to add the paths to the LD_LIBRARY_PATH manually in the run environment.)

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TobbY
      wrote on last edited by
      #2

      u can use like this for windows.

      LIBS += C:\QtSDK\mingw\lib\libws2_32.a

      or read

      http://doc.qt.nokia.com/qq/qq11-unix-deployment.html#sharedlibraries

      1 Reply Last reply
      0
      • L Offline
        L Offline
        ludde
        wrote on last edited by
        #3

        Not sure I understand your answer, and not really sure you understood my question either... :)

        My question does not have anyhting to do with deployment.
        It has to do with running my application from Qt Creator, pressing the Run button or Ctrl-R.
        And I know how to make qmake find libraries at compile time.
        What I don't understand is how Qt Creator finds the corresponding DLLs at run time.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Dynasty1215
          wrote on last edited by
          #4

          Hi, ludde
          Did you solved it?
          I have the same problem, i add a .so file to my application
          Then it compiled and link is ok
          But when i pressing the Run button or Ctrl-R, there some error:
          “To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH.
          dh_shlibdeps: command returned error code 512”

          how do i set the LD_LIBRARY_PATH

          1 Reply Last reply
          0
          • L Offline
            L Offline
            ludde
            wrote on last edited by
            #5

            Hi.

            You can set LD_LIBRARY_PATH in the run environment in Qt Creator. The run environment is accessible on the Projects page, under Run Settings. Just press the Details button under Run Environment, and then the Add button. (This is for Qt Creator 2.4.1, it might look slightly different in another version.)

            I'm not developing on Linux at the moment, so I don't have this problem any more, and don't know if it has been fixed in a recent Qt Creator release. But if you have the same problem, I guess it hasn't. But setting LD_LIBRARY_PATH as I describe should solve it for you.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              Dynasty1215
              wrote on last edited by
              #6

              Thx
              I can founded the run environment is accessible on the Projects page, under Run Settings.
              But i don't know how set the "LD_LIBRARY_PATH" 's value. It is "value" would be what?

              1 Reply Last reply
              0
              • L Offline
                L Offline
                ludde
                wrote on last edited by
                #7

                The value is the full path of the directory where the DLLs are located.
                If they are spread over more than one directory, the value is a list of directories, separated by a ':' character.

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tobias.hunger
                  wrote on last edited by
                  #8

                  Ludde: Creator evaluates the LIBS variable from qmake and sets up the environment in such a way that those libs are found. That the first case does not work is a bug. Did you "file a report":http://bugreports.qt-project.org/ for it?

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    ludde
                    wrote on last edited by
                    #9

                    Yes, I filed this as "QTCREATORBUG-5394":https://bugreports.qt-project.org/browse/QTCREATORBUG-5394.
                    Current status: Not Evaluated.

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      Dynasty1215
                      wrote on last edited by
                      #10

                      Thanks all
                      Problem solved here :http://www.developer.nokia.com/Community/Wiki/How_to_deploy_and_link_a_shared_library_on_Harmattan

                      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