Razvan's Technology Blog

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
Posted by Razvan Beuran at 17:25 No comments:
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

About Me

My photo
Razvan Beuran
View my complete profile

Blog Archive

  • ►  2022 (2)
    • ►  March (1)
    • ►  February (1)
  • ►  2021 (1)
    • ►  April (1)
  • ►  2020 (1)
    • ►  December (1)
  • ►  2018 (1)
    • ►  September (1)
  • ►  2017 (4)
    • ►  June (1)
    • ►  February (3)
  • ►  2016 (2)
    • ►  May (1)
    • ►  April (1)
  • ►  2015 (5)
    • ►  October (1)
    • ►  August (1)
    • ►  May (1)
    • ►  February (1)
    • ►  January (1)
  • ▼  2014 (1)
    • ▼  March (1)
      • static linking in gcc
  • ►  2013 (15)
    • ►  December (2)
    • ►  November (1)
    • ►  October (3)
    • ►  September (2)
    • ►  August (2)
    • ►  July (1)
    • ►  February (4)
  • ►  2012 (13)
    • ►  August (1)
    • ►  July (2)
    • ►  June (5)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  January (2)
  • ►  2011 (1)
    • ►  February (1)
  • ►  2010 (8)
    • ►  November (1)
    • ►  August (1)
    • ►  April (4)
    • ►  February (2)
Simple theme. Powered by Blogger.