Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8300377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:32:41+00:00 2026-06-08T16:32:41+00:00

I need to ship a product with shared libraries (Ubuntu) in a folder I’ve

  • 0

I need to ship a product with shared libraries (Ubuntu) in a folder I’ve created (‘shared’) within the project directory–i.e., shared libraries that are not in /usr/lib, /usr/local/lib, etc. To this end I’ve done this in the .pro file, i.e.

LIBS += -Lshared/gsl -lgsl -lgsl_cblas

NB the executable is in the same directory asy the ‘shared’ folder. Everything works when I launch the program in debug mode from QtCreator. In addition the program fails to launch if I remove or rename the libs in ‘shared’, and also I’ve verified that the app is not finding these libraries anywhere else. But when I launch from the command line, I get

error while loading shared libraries: libgslcblas.so.0: cannot open
shared object file: No such file or directory

What’s going on?

EDIT: The solution is a variation on lionbest’s below, as developed in the comments. For some reason, it turns out that on my platform qmake/QMAKE_FLAGS only allows a specific format for linker options, and not the one you find googling around for other instances where people have worked with QMAKE_FLAGS. Namely,

QMAKE_FLAGS += "-Wl,-rpath,\'\$$ORIGIN/shared/gsl\'"
QMAKE_LFLAGS_RPATH=

Specifically, the problem was that the parser (or linker) would not accept -rpath=..., despite the fact that this seems to work for everyone else. Ubuntu 12.04, gcc 4.6.3, Qt 4.8.0, QtCreator 2.4.1 “based on Qt 4.7.4”. Hope this experience can save someone else the same frustration.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:32:42+00:00Added an answer on June 8, 2026 at 4:32 pm

    Start a program with environmental variable LD_LIBRARY_PATH=shared/gsl or add a RPATH to linker settings:

    LIBS += -Wl,-rpath=shared/gsl
    

    If you want to make shortcut for your application, most distribution (based on Gnome, KDE, LXDE and XFCE) use a .desktop file. QtCreator probably generated one for you. You need to edit it or generate it, and put to $HOME/.local/applications or /usr/share/applications/ during installation. In desktop file you could add envirometal varible and starting directory as follow:

    Exec=/usr/bin/env LD_LIBRARY_PATH=/<path_to_libs>/ /<path>/app -extra_options
    

    If you need to run your application in specific directory add line:

    Path=/<path_to_your_application_working_dir>
    

    You can use ${} inside path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to ship some Java code that has an associated set of data.
We have a product that we need to create an installer for. It has
I ship a public header that users compile against to utilize classes contained within.
I need open source database that I can ship with my commercial application. It
I need to ship an app that uses read-only access to several preexisting SQLite3
I've got a bunch of products with sizes to ship and I need to
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need help with a query that I wrote: I have three tables Company id
i need to customize the page that user sees at url: user/%user/orders/%uc_order i tried
We need to ship and deploy .Net 3.5 in a cd to clients who

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.