Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Looking for dlls to be linked dynamically under a specific folder?

    General and Desktop
    2
    6
    1088
    Loading More Posts
    • 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.
    • D
      dolevo last edited by

      Hi all,

      I have an application which requires 3 dlls. For a certain reason, I need to put the dlls under a specific folder. Could you please tell me if there is an easy code to add .pro file or any other part so that the executable will look for the dlls to link dynamically under the specific folder?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        @
        LIBS += -L/path/to/your/libs -llib1name -lib2name -lib3name
        @

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • D
          dolevo last edited by

          [quote author="sierdzio" date="1371814853"]@
          LIBS += -L/path/to/your/libs -llib1name -lib2name -lib3name
          @[/quote]

          But this is not for runtime right? I have this line in my pro file but it is pointing to the folder where I put the dlls for build.

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            No, of course, it is for linking, just as you have asked.

            How the OS provides shared libraries is outside of Qt's scope. On Windows, the DLL needs to either be installed in system32, or reside in current directory.

            Unix OSes are much more flexible in that respect.

            (Z(:^

            1 Reply Last reply Reply Quote 0
            • D
              dolevo last edited by

              So there is no way to say the application that on runtime if you want to link a dll, go and find it under ... folder.

              1 Reply Last reply Reply Quote 0
              • sierdzio
                sierdzio Moderators last edited by

                Nope.

                Read through "this":http://stackoverflow.com/questions/107888/is-there-a-windows-msvc-equivalent-to-the-rpath-linker-flag, though, if you are interested in workarounds.

                (Z(:^

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post