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. Storing libraries in a particular folder
Forum Updated to NodeBB v4.3 + New Features

Storing libraries in a particular folder

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.3k 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.
  • K Offline
    K Offline
    Ketan Shah
    wrote on last edited by
    #1

    I am making a Qt Gui C++ application using shared libraries for windows...
    my question is when I am including dlls in my application, I want to store the dlls in a particular folder(bin folder) and the executable is out of that folder.
    is this possible??
    and if possible what changes I should make in the .pro file, so that when executing the executable it can find the respective dlls.
    please reply..

    Thanks in advance,
    Ketan Shah.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soroush
      wrote on last edited by
      #2

      I didn't do this before but I think you should be able to load libraries at runtime using "QLibrary":http://doc.qt.nokia.com/latest/qlibrary.html

      Also try :
      @
      QStringList path = QCoreApplication::libraryPaths();
      path.append(qApp->applicationDirPath()+"\bin");
      QCoreApplication::setLibraryPaths(path);
      @

      Where bin folder is where you put dlls (inside application install directory).

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

        Why not put the exe in the bin dir along with the dll's? That way no changes are needed to environment.

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Ketan Shah
          wrote on last edited by
          #4

          but if possible i dont want to keep the dlls and exe together...
          is there any proper way to do that...

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on last edited by
            #5

            In that case you need to tell the system where to find your dll's. That is you need to somehow alter the %PATH% environment variable. You could do this in a simple wrapper script that launches the real application or a compiled stub application. You may even be able to do it in a windows shortcut (I can't recall off the top of my head).

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            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