March 6, 2014

static linking in gcc

In order to force static linking in gcc/g++ you need to use the option
'-static'. However, unless you have installed in advance the static
versions of the glibc libraries you will receive an error such as:
> /usr/bin/ld: cannot find -lm

To install the static versions of the libraries, on RHEL variants for
instance, run:
> sudo yum install glibc-static

No comments:

Post a Comment