Results 1 to 5 of 5

Thread: MinGW Windows Library Search Path

  1. #1
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default MinGW Windows Library Search Path

    Hello *
    I'm trying to make a binary distribution of my project for Windoze.
    The project compiles fine, resolves its library dependencies and is able to run, but only if the used DLLs (Qt4: QtCore, QtGui and QtXml; some other libraries) reside in the the same directory as the application. I would like to put all libraries into a subfolder (lib) and have only the executable in the application root directory, but whenever I start the application with this configuration it complains about not finduing the DLLs. If I start via a BATch-file and set the PATH environment accordingly it works, but this is not an acceptable solution.
    QCoreApplication brings some static methods to set the library include paths, but they don't work cause the the application fails to start due to the missing libraries in the dynamic library loader before even executing the first statements....
    I also tried messing around with linker flags adding a -Wl,-rpath,lib, but after it didn't work I checked with the documentation and found out that the mingw-gcc ignores the rpath...
    I don't want to l link it static because there is a proprietary library where no static version is available...

    Has anybody any idea on how to solve this?

    Thanks in advance

  2. #2
    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: MinGW Windows Library Search Path

    You have to convince Windows to look for the library there. There is probably some environment variable in the system which stores a list of library paths. An alternative is to install those libs you need in Windows' System directory.

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

    zztop (23rd March 2006)

  4. #3
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: MinGW Windows Library Search Path

    Thanks wysota, but there has to be another (more windows like) way to do this.
    Installng all libraries to some windows internal include path requires admin rights and setting/including my path to an environment variable is the same as starting from a batch file.
    It's simply not very nice
    It would be really nice to run for example from CD or USB stick and adding a temporary path to a system include path sounds wrong...

  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: MinGW Windows Library Search Path

    Quote Originally Posted by zztop
    Thanks wysota, but there has to be another (more windows like) way to do this.
    Installng all libraries to some windows internal include path requires admin rights and setting/including my path to an environment variable is the same as starting from a batch file.
    It's simply not very nice
    It would be really nice to run for example from CD or USB stick and adding a temporary path to a system include path sounds wrong...
    You can modify the environment just for one binary (at least it should be possible). I think you can do this by modifying properties of the file (or a shortcut to it).

  6. #5
    Join Date
    Jan 2006
    Posts
    109
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: MinGW Windows Library Search Path

    Quote Originally Posted by zztop
    I would like to put all libraries into a subfolder (lib) and have only the executable in the application root directory, but whenever I start the application with this configuration it complains about not finduing the DLLs.
    Why would you want to do that? The usual and recommended way on Windows is to put the DLLs needed by an application in the application's directory. See also:

Similar Threads

  1. Replies: 7
    Last Post: 22nd December 2010, 08:13
  2. A Guide to Install MinGW, Qt4 and Eclipse Integration on Windows XP
    By shiyutang in forum Installation and Deployment
    Replies: 10
    Last Post: 5th August 2009, 04:03
  3. how does Qt know the library path in LINUX
    By babu198649 in forum General Programming
    Replies: 1
    Last Post: 14th November 2008, 17:10
  4. Qt + boost + MinGW on Windows
    By akos.maroy in forum Newbie
    Replies: 3
    Last Post: 12th June 2008, 14:53
  5. QT 4.2.2 Windows Mingw
    By KaptainKarl in forum Installation and Deployment
    Replies: 3
    Last Post: 4th May 2007, 14:57

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.