Solved

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

Posted on 2008-11-01
3
485 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
3 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 70 total points
ID: 22862249
0
 
LVL 61

Assisted Solution

by:gheist
gheist earned 55 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now