?
Solved

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

Posted on 2008-11-01
3
Medium Priority
?
495 Views
Last Modified: 2013-12-16
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
Comment
Question by:brycen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 210 total points
ID: 22862249
0
 
LVL 62

Assisted Solution

by:gheist
gheist earned 165 total points
ID: 22865265
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
 
LVL 3

Author Closing Comment

by:brycen
ID: 31512439
More detail on static vs. dynamic linking would have helped.  But the pointers got me going.
0

Featured Post

Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question