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. App frn linux console… is not finding the libs
Forum Updated to NodeBB v4.3 + New Features

App frn linux console… is not finding the libs

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 1.8k 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.
  • A Offline
    A Offline
    arsinte_andrei
    wrote on last edited by
    #1

    bq.
    You can also set the rpath when building your library on OS X

    can you hlp me also with rpath please.. I have also some library and when run my app frn linux console... is not finding the libs witch are next to the executable file in my home folder.

    [andreyc EDIT]: Split "from":http://qt-project.org/forums/viewthread/47425/#194194. Please start new thread for your questions. It will be easier to find the new questions if they are not buried inside the other threads.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      You can set LD_LIBRARY_PATH to search in current directory at run time
      @
      export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
      @
      or you can specify rpath during build to make your app to search in a particular path
      @
      g++ ... -Wl,-rpath,$(HOME)
      @
      or use dot instead of $HOME. I did not test it
      @
      g++ ... -Wl,-rpath,.
      @

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        This "blog post":http://www.tripleboot.org/?p=138 has a very detailed explanation on how to deploy your application in Linux.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • A Offline
          A Offline
          arsinte_andrei
          wrote on last edited by
          #4

          may I get some more info about rpath in my pro file? or where I have to add @g++ ... -Wl,-rpath,$(HOME)@
          this is my pro file
          @include (../shared.pri)
          SUBDIRS =
          AtpCore
          AtpTools
          AtpClient
          AtpCompany
          AtpGui
          main

          TEMPLATE = subdirs
          @

          my shared .pri @DEFINES += ATP_LIBRARY

          output directory:

          CONFIG(debug, debug|release) {
          ROUTDIR = debug
          } else {
          ROUTDIR = release
          }

          CONFIG(plugin, plugin) {
          build_pass:CONFIG(debug, debug|release) {
          TARGET = $$join(TARGET,,,_debug)
          }
          }

          QT += core
          gui
          sql \

          svg \

          network
          printsupport
          xml
          xmlpatterns \

          help \

          designer
          uitools
          widgets
          webkitwidgets

          CONFIG -= warn_off
          CONFIG += warn_on
          CONFIG += debug_and_release ordered embed_manifest_dll embed_manifest_exe

          QMAKE_TARGET_COMPANY = atp-trading.net
          QMAKE_TARGET_DESCRIPTION = an application for people involved in electric jobs
          QMAKE_TARGET_COPYRIGHT = Open Source
          QMAKE_TARGET_PRODUCT = atpElectricity Application Framework

          QMAKE_CXXFLAGS += -std=c++11
          CONFIG += c++11

          DESTDIR = $$PWD/$$ROUTDIR
          UI_DIR = .ui

          LIBS += -L$$PWD/$$ROUTDIR

          INCLUDEPATH +=
          $$PWD/src/AtpCore
          $$PWD/src/AtpTools
          $$PWD/src/AtpClient
          $$PWD/src/AtpCompany
          $$PWD/src/AtpGui@

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andreyc
            wrote on last edited by
            #5

            I think you should add it to QMAKE_CXXFLAGS
            @
            QMAKE_CXXFLAGS += -Wl,-rpath,$(HOME)
            @

            1 Reply Last reply
            0
            • hskoglundH Online
              hskoglundH Online
              hskoglund
              wrote on last edited by
              #6

              Hi, actually it's
              @
              QMAKE_LFLAGS += -Wl,-rpath,$(HOME)
              @

              but this I just found out, thanks arsinte_andrei for this excellent question; while I haven't been using Qt in Linux much, I always forget doing the chrpath command (as I write in that "blog post":http://www.tripleboot.org/?p=138#Linux) so I want something to stuff inside my .pro file and be done with it, and QMAKE_LFLAGS is it :-)

              But the real kicker of course, is to be able to issue an LFLAGS to emulate the DLL lookup behavior in Windows, i.e. to have the ld.so chap look for Qt's .so files in the same directory as the executable .elf file, regardless of that file is in your home directory or somewhere else entirely. In my blog post I use chrpath -r $ORIGIN for this, so how to do that magic in the .pro file?

              Well with a lot of coffee later. I present to you:
              @
              QMAKE_LFLAGS += -Wl,-rpath,"'$$ORIGIN'"
              @

              I can explain exactly why all that extra stuffing/escaping is needed, but maybe later :-) Anyway I'm going to update the blog...

              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