1. GCC 4.6 linker switches

    Thu 16 February 2012

    Category: etc.

    Tags: C unix

    An odd little one: I was compiling some older code on gcc 4.6 / Ubuntu 11.10 and it failed to make, with the traditional error:

    undefined reference to `sqrt'

    My Makefile was trying to do something like this:

    gcc -c -o eg.o eg.c
    gcc -lm -o eg ...
    read more