Results 1 to 5 of 5

Thread: Lib path

  1. #1
    Join Date
    Dec 2007
    Location
    London
    Posts
    206
    Thanks
    40
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Lib path

    Hello,

    What is the difference between "setting the env var "LD_LIBRARY_PATH=./blabla" " and setting LIBS += -L./blabla in the project file. Ive thought they do the same job;but usually i am getting have to set the LD_LIBRARY_PATH to make my application working...

    thanks in advance...
    Last edited by yagabey; 3rd April 2009 at 08:25.

  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: Lib path

    LIBS+= is something related to the compiler (it tells the compiler/linker where to look for libraries it might need and which ones to link against your application). LD_LIBRARY_PATH is something related to your system's dynamic linker that does its job when an application is being started (it tells the dynamic linker where to look for libraries that need to be put into your process's address space). You can compile and run the application on different machines so an absolute and hard path would be a bad idea.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2007
    Location
    London
    Posts
    206
    Thanks
    40
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Lib path

    Thanks, it is clear now... Should i always use "export LD_LIBRARY_PATH" command for dynamic libraries? In windows, it is enough to put the dll s into the same directory with executable; but for linux i have to use "export LD_LIBRARY_PATH=."

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Lib path

    yes, plus u can always create a small shell script for it

  5. #5
    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: Lib path

    Quote Originally Posted by yagabey View Post
    Thanks, it is clear now... Should i always use "export LD_LIBRARY_PATH" command for dynamic libraries? In windows, it is enough to put the dll s into the same directory with executable; but for linux i have to use "export LD_LIBRARY_PATH=."
    You can place the libraries in a directory where the linker will look for it. It's the same in Windows, only that in Windows one of those directories is the directory containing the executable. On Linux it is not, probably due to security reasons. Instead od using LD_LIBRARY_PATH you can add the path to /etc/ld.so.conf.d/ or /etc/ld.so.conf.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. File path issue...
    By kaushal_gaurav in forum Qt Programming
    Replies: 9
    Last Post: 1st October 2008, 15:36
  2. QFileDialog disable Dir Path
    By user_mail07 in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2008, 19:57
  3. how do I get the default picture path of qtopia 2.2
    By pencilren in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th September 2007, 09:01
  4. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  5. Which path should I use?
    By Dark_Tower in forum Newbie
    Replies: 3
    Last Post: 8th April 2006, 12:09

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.