This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: math.h prob
- To: help-gcc at gnu dot org
- Subject: Re: math.h prob
- From: haha at here dot org
- Date: 3 Nov 1999 15:54:25 GMT
- Newsgroups: gnu.gcc.help
- Organization: What! Me? Worry!?
- References: <38204719.FD2DC371@clinmed.gla.ac.uk>
- Xref: wodc7nx0 gnu.gcc.help:1662
:>I am fairly new to C programming, especially to using gcc, so I am sorry
:>if my question is a bit simple!
<SNIP>
:>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
You need to link the math library to your program with the -lm option. I
recommend you don't call your program 'test', since this is a command:
gcc -o math_test mattest.c -lm
Haha!