This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc problem.
- To: mohamed farid <mfarid at lucent dot com>
- Subject: Re: gcc problem.
- From: Eric Christopher <echristo at cygnus dot com>
- Date: Mon, 04 Dec 2000 09:10:47 -0800
- CC: gcc-bugs at gcc dot gnu dot org
- References: <3A2B9B2B.27E85D6E@lucent.com>
mohamed farid wrote:
>
> Dear all,
> I have a problem while compiling a C file using gcc. The
> problem arise when i try to include <math.h> and use any of it's
> functions as "pow". The compiler gives the following error "undefined
> reference to `pow` ld returned 1 exit status "
> I have configured all the pathes the LD_LIBRARY_PATH and the INCLUDEDIR
> Please help me solving this problem
>
You need to link with the math library as well. For example,
gcc -o foo foo.c -lm
-eric