Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Wth?

Name: Anonymous 2011-08-15 5:38


#include <stdio.h>
#include <math.h>

int main()
{
    double phi = (1 + sqrt(5))/2;
    int n = 12;
    n = (pow(phi,(double)n) - pow((1 - phi),(double)n))/sqrt(5);
    printf("%d \n", n);
}


gcc --std=c99 name.c

undefined reference to 'pow'
undefined reference to 'pow'

gcc name.c

undefined reference to 'pow'
undefined reference to 'pow'

What am I doing wrong? The standard library is install and the man pages do have a description of double pow(double, double)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List