Results 1 to 5 of 5

Thread: Setting LD_LIBRARY_PATH from Qt Creator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Setting LD_LIBRARY_PATH from Qt Creator

    Hi all,
    I'm having problems with something that should be very easy.
    I have a project which creates a dynamic library and an executable. So far I have only compiled it on Windows and I use the following setup:

    Qt Code:
    1. #Library pro file
    2. TEMPLATE = lib
    3. DESTDIR = ../lib
    4. DLLDESTDIR = ../bin
    5. DEFINES += CREATE_DLL
    6. CONFIG += debug_and_release
    7.  
    8. build_pass:CONFIG(debug, debug|release) {
    9. TARGET = $$join(TARGET,,,d)
    10. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #Application pro file
    2. TEMPLATE = app
    3. DESTDIR = ../bin
    4. LIBS += -L../lib
    5. CONFIG += debug_and_release
    6.  
    7. CONFIG(release, debug|release){
    8. LIBS += -lMyLib
    9. }
    10. build_pass:CONFIG(debug, debug|release){
    11. TARGET = $$join(TARGET,,,d)
    12. LIBS += -lMyLibd
    13. }
    To copy to clipboard, switch view to plain text mode 

    Now I want to debug the application on Linux with Qt Creator. I'm using Ubuntu.

    I load the project into Creator and I can compile it just fine in debug or relase mode. The problem arises when I want to launch the application.
    Failed to start program. Path or permissions wrong?
    I can start the app from a terminal if I call
    Qt Code:
    1. export LD_LIBRARY_PATH=/path/to/lib
    2. ldconfig
    To copy to clipboard, switch view to plain text mode 
    But setting LD_LIBRARY_PATH from within Qt Creator has no effect.
    I could of course fix it by setting LD_LIBRARY_PATH globally before I start Qt Creator, but that isn't convinient, since I have a lot of projects with the same setup.

    So I was wondering if someone could tell me what the cannonical way is to set up your pro files for a project using dynamic libs(in a portable way). None of the examples or demos from Qt use dynamic libs(not counting plugins, since they're a differnt story alltogether).

    I'm greatful for any help and apologize beforehand for my linux noobishness.

  2. The following user says thank you to spud for this useful post:

    zeFree (2nd November 2011)

Similar Threads

  1. LD_LIBRARY_PATH problem
    By sincnarf in forum General Programming
    Replies: 3
    Last Post: 29th August 2020, 18:58
  2. Using git with qt creator
    By dreamh4k in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2010, 00:18
  3. Qt Creator
    By fnmblot in forum General Discussion
    Replies: 3
    Last Post: 12th April 2009, 08:06
  4. Qt Creator
    By const in forum Qt Tools
    Replies: 26
    Last Post: 16th February 2009, 22:10
  5. Mysql LD_LIBRARY_PATH Issue
    By Think_Positive in forum Installation and Deployment
    Replies: 3
    Last Post: 13th February 2007, 19:16

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
  •  
Qt is a trademark of The Qt Company.