[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Simple c program won't compile



Hi,

The following program:


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

int main(int argv, char **argc){
  double x;

  x=sqrt(5.0);
}


does not compile.  Instead I get the errors:

$ gcc thick.c
/tmp/ccU9fgSr.o: In function `main':
/tmp/ccU9fgSr.o(.text+0x16): undefined reference to `sqrt'
collect2: ld returned 1 exit status


What is wrong?

Thanks,

Mark.

-- 
_/~~~~~~~~\___/~~~~~~\____________________________________________________
____/~~\_____/~~\__/~~\__________________________Mark_Phillips____________
____/~~\_____/~~\________________________________mark@ist.flinders.edu.au_
____/~~\HE___/~~\__/~~\APTAIN_____________________________________________
____/~~\______/~~~~~~\____________________________________________________
__________________________________________________________________________
        "They told me I was gullible ... and I believed them!" 



Reply to: