For When You Can't Have The Real Thing
[ start | index | login ]
start > Linux > Building Static Programs

Building Static Programs

Created by dave. Last edited by dave, 13 years and 25 days ago. Viewed 1,965 times. #1
[edit] [rdf]
Sometimes you don't have access to the fancy dynamically-loaded libraries in your runtime environment that your build environment has. In the extreme, you might have no dynamic libraries.

To build your program so that it is a staticly-linked binary, you might try:

export CFLAGS='-static'
...before your ./configure and make commands.

This doesn't work in nearly all circumstances, but in some simple cases it might.

This worked for me when building a rsync for my webhost environment which lacked certain libraries (specifically, a magic version of libc).

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt