Re: Simple c program won't compile
* On 05-03-01 at 15:23 Mark Phillips (mark@infoeng.flinders.edu.au) wrote:
+----Here quoted text begins----+
> 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.
[...]
+----and here the quote ends----+
Exactly what it says...
You haven't defined the sqrt ... is it integer, char... anything else???
and compiling as far as I recall it is usually done by gcc thick.c -o thick
Good luck
B.
--
Boštjan Müller [NEONATUS], neonatus@neonatus.net, http://neonatus.net/~neonatus
For my PGP key finger: neonatus@neonatus.net, RSA id: 0x90178DBD, ICQ #:7506644
Celular: +386(0)41243189, Powered by Debian GNU/LiNUX , Student of VFUL
Error in operator: add beer
Reply to: