Results 1 to 6 of 6

Thread: Hot to define the directory for the dynamic libraries?

  1. #1
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question Hot to define the directory for the dynamic libraries?

    Hi, I've created an application that needs the dynamic libraries QtGui4.dll, QtCore4.dll, mingwm10.dll and the folder /plugins/imageformats for the images libraries. I would like to place all these libraries in a sub directory in the application main directory called "libs". Could you please tell me what I need to include in the Makefile or the project file to obtain an executable with this performance? Thanks.

  2. #2
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hot to define the directory for the dynamic libraries?

    Have a look at the 'Using qt.conf' article in your documentation.

  3. The following user says thank you to durbrak for this useful post:

    Dark_Tower (15th December 2006)

  4. #3
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hot to define the directory for the dynamic libraries?

    I've readed the doc "Using qt.conf" and created the qt.conf with this content:
    Qt Code:
    1. [Paths]
    2. Libraries = /libs/4.2
    3. Plugins = /libs/4.2
    To copy to clipboard, switch view to plain text mode 
    I've copied the libraries at /libs/4.2 but the application doesn't start because it doesn't find the libraries. Are correct the contents of the qt.conf file?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Hot to define the directory for the dynamic libraries?

    I'm afraid qt.conf won't help you with that. Qt libraries are linked by the dynamic loader, so QLibraryInfo doesn't have time to initialise itself before it is even loaded into process address space. You can only manipulate plugins search paths this way, but not Qt libs themselves.

    Quote Originally Posted by Using qt.conf
    Without qt.conf, the Qt libraries will use the hard-coded paths to look for plugins, translations, and so on. These paths may not exist on the target system, or they may not be accesssible. Because of this, you need qt.conf to make the Qt libraries look elsewhere.

  6. The following user says thank you to wysota for this useful post:

    Dark_Tower (16th December 2006)

  7. #5
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hot to define the directory for the dynamic libraries?

    Thanks wysota, now I understand why QCoreApplication::addLibraryPath only is useful for the plugins path

  8. #6
    Join Date
    Dec 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Hot to define the directory for the dynamic libraries?

    You could also set the environment PATH to include your libs directory. Then the Windows loader will find them when launching your app.

Similar Threads

  1. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 12:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.