Solved

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

Posted on 2008-11-01
3
487 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 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

773 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