public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* math.h prob
@ 1999-11-03  8:21 Dave Brennan
  1999-11-03  8:27 ` Art Haas
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Dave Brennan @ 1999-11-03  8:21 UTC (permalink / raw)
  To: help-gcc

Hi,

I am fairly new to C programming, especially to using gcc, so I am sorry
if my question is a bit simple!

I am using gcc 2.8.1 on a Sun workstation (solaris 2.7).

I am having problems using maths functions. e.g if I have the program

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

main()
{

double x;

scanf("%lf",&x);

printf("x = %lf",sqrt(x));


}

and try to compile it using,

gcc -o test mattest.c

I get the following error:

Undefined                       first referenced
 symbol                             in file
sqrt                                /var/tmp/cc9Eay_r1.o
ld: fatal: Symbol referencing errors. No output written to test

Does anyone know why this is happening?

Thanks for the help.


Dave Brennan

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1999-11-30 23:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-03  8:21 math.h prob Dave Brennan
1999-11-03  8:27 ` Art Haas
1999-11-30 23:28   ` Art Haas
1999-11-03  8:28 ` haha
1999-11-30 23:28   ` haha
1999-11-03  8:30 ` Ffoobarr
1999-11-30 23:28   ` Ffoobarr
1999-11-03  9:51 ` Dave Brennan
1999-11-30 23:28   ` Dave Brennan
1999-11-03 13:25 ` Rick Dearman
1999-11-30 23:28   ` Rick Dearman
1999-11-30 23:28 ` Dave Brennan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).