Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 503
  • Last Modified:

Tie specific binary to specific shared library (not with LD_LIBRARY_PATH)

I've got a locally compiled binary that needs a locally compiled shared library.

An older version of the same binary (and shared library) are installed from a Debian Etch  package... and can't be touched.

I can make the new binary run with a hacky wrapper script like:

#!/bin/sh
#Script hack to load new client on machine with older base
export LD_LIBRARY_PATH=/usr/local/bin
/usr/local/bin/bclient -h /var/run/bclient/ $@

But is there a better way?  I tried adding -static to the gcc compile step, but this resulted in a pile of errors (on a complex bit of code I don't know)
0
brycen
Asked:
brycen
2 Solutions
 
ravenplCommented:
0
 
gheistCommented:
You can link with particular library in current directory -l ./lib.so or compile on oldest machine available.

What are actual errors from static compilation?
0
 
brycenAuthor Commented:
More detail on static vs. dynamic linking would have helped.  But the pointers got me going.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now