Solved

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

Posted on 2008-11-01
3
490 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 70 total points
ID: 22862249
0
 
LVL 62

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
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 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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

734 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