Peter's Site

  • Homepage
  • Login

Sep 24: Shared libs in /usr/local/lib

Just a quick note to myself:
In Linux, shared C object libraries (.so) are usually found in /usr/lib which is also in the default linker search path. A problem arises when compiling programs requiring shared libraries located in /usr/local/lib, the directory for non-system libraries. The resulting binary can usually not be executed, since the shared object files are not found during runtime. Common hacks are setting the LD_LIBRARY_PATH environment variable (linker search path) to include /usr/local/lib or editing /ect/ld.so.conf to include this path.

A more portable solution is to include /usr/local/lib in the run path of the binary file with the ld option -R. When using g++ for linking, use the option -Wl,-rpath,/usr/local/lib. The resulting binary can now run without extra hacks.

More info.

Posted by Peter in Programs Comments: (0) Trackbacks: (0)

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

No comments


Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

 
 

Calendar

Back July '10
Mo Tu We Th Fr Sa Su
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Seiten

Frontpage
Particle Graphs
Page Graphs
Validation Graphs

Blogroll / Links

  • Mario
  • Mr. Spock
  • Roland
  • Sebastian
  • Seebi
  • Stefan
  • Sylvia
  • Uli

Categories

  • XML Copenhagen
  • XML Geek stuff
  • XML Geocaching
  • XML IMISE
  • XML L.E.
  • XML Misc
  • XML Programs
  • XML Science
  • XML Traveling


All categories

Syndicate This Blog

XML RSS 0.91 feed
XML RSS 1.0 feed
XML RSS 2.0 feed
ATOM/XML ATOM 0.3 feed
ATOM/XML ATOM 1.0 feed
XML RSS 2.0 Comments

Geocaching

Überwachung

Zensur