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

  • Home
  • SEARCH
  • 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 6773955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:43:46+00:00 2026-05-26T15:43:46+00:00

Sorry about the title, couldn’t really think of anything else to describe the problem

  • 0

Sorry about the title, couldn’t really think of anything else to describe the problem 🙂

Ok, so the thing is like this: I’m trying to use a proprietary freeware application under Linux (and hence the problem; if I had the source, I could have rebuilt it). Furthermore, I’m trying to run it on an unsupported flavor of Linux, and nearly all components of the application work individually, but not together (as they should if the application ran fully).

Let me clarify a bit. There is a GUI, that starts up fine in the unsupported OS. Then, from this GUI, you can call a bunch of command line tools – helpfully, the GUI also spits out the command line being called in each case.

Now, called from the GUI some of these commands fail – however, since I have the actual command line called (let’s say: “extprogram -arg1 1 -arg2 2 ...“), I can repeat these from the terminal. And so, I discover that the application as a whole carries it’s own libc libraries; and using these libraries, (some of) the commands (ran from the terminal) tend to fail – however, I discovered that from the command line, this usually works for those that fail:

LD_PRELOAD=/usr/lib/libstdc++.so.6 extprogram -arg1 1 -arg2 2 ...

# or alternatively, this works too:
# LD_LIBRARY_PATH=/usr/lib extprogram -arg1 1 -arg2 2 ...

(in other words, using the system libstdc++ instead of the application supplied one, tends to fix things)

 

So, now if I could persuade the GUI to call these tools with “LD_PRELOAD“/”LD_LIBRARY_PATH” – I guess, all would work fine…

Unfortunately, the GUI doesn’t call a script that would further call these executables, which I could change directly (as far as I could see via grepping) – seemingly, it’s the GUI executable that creates the system calls; I tried ‘strace‘-ing, but I cannot find something like a temporary script or anything that I could change…

 

So, I thought maybe I could “cheat” with making an executable bash script; so I move the executable – and create a script that should call the moved executable with LD_ prepended:

mv extprogram extprogram.old
cat > extprogram <<EOF
LD_LIBRARY_PATH=/usr/lib extprogram $@
EOF

… but this fails; apparently GUI application recognizes something is not right.

 

So, I was thinking – is it possible to somehow, maybe, have a C/C++ code “wrapper” that would somehow “load” this executable, but in an “environment” which has “LD_LIBRARY_PATH=/usr/lib” set – and pass it its arguments (and also return it’s return value)? Then I could build this “wrapper” natively on the OS, with the same name as the original executable – and have the whole thing working, without touching the original executable (apart from renaming).

Many thanks in advance for any answers,
Cheers!

  • 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-05-26T15:43:46+00:00Added an answer on May 26, 2026 at 3:43 pm

    You’re close. You forgot the shebang and to make the script executable. Also you were calling the wrong external program. Finally, I’d use the absolute path to the old script, because you don’t know what the CWD will be for the GUI.

    mv extprogram extprogram.old
    cat > extprogram <<EOF
    #!/bin/sh
    LD_LIBRARY_PATH=/usr/lib exec /psth/to/extprogram.old "$@"
    EOF
    chmod +x extprogram
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry about the title, I couldn't think of a better way to describe the
Sorry about the vague title, but I really don't know how to describe this
Sorry for the bad title (couldn't think of a better way to describe it)
Sorry about the title but could not come up with anything really informative and
Sorry about the title, I don't think I could explain it right: This is
sorry about the title, I'm not sure how to even describe this, which makes
Sorry about the title, not sure how to describe without example. I trying to
Sorry about the bad title, I couldn't think of a more descriptive one. The
Sorry about the poorly articulated title, I couldn't think of a title that would
Sorry about the title but I can't really think of a quick way of

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.