The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM



Thread: dynamic linking
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 05-23-2007
jim mcnamara jim mcnamara is offline
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,373
If this is production code, don't link against your own directory tree. Terrible idea. Instead compile your shared library into a archive (.a). Link statically against the .a file.

cc myprogram.c /myhome/lib.libwhatever.a -o myprogram

The executable image will then run pretty much anywhere, on any system that supports the archictecture on your development system - and that has the same libc The downside is that the app will use more memory.
Reply With Quote