The problem is that glibc's math.h like to inline math functions so that is why you are seeing some undefined function and some that are defined, to correct this add -lm agurment when linking, this links in the math library which is needed for math functions. Thanks, Andrew Pinski