This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Linker problem - undefined reference after including math lib
- To: help-gcc at gnu dot org
- Subject: Re: Linker problem - undefined reference after including math lib
- From: Ari Pollak <compwiz at bigfoot dot com>
- Date: Thu, 11 Nov 1999 17:33:50 -0500
- Newsgroups: comp.lang.c,gnu.gcc.help
- Organization: Monmouth Internet
- References: <382B402F.752C71C@bigfoot.com> <87yac44qkw.fsf@pfaffben.user.msu.edu>
- Xref: wodc7nx0 comp.lang.c:22109 gnu.gcc.help:1788
Heh. thanks. Sorry, stupid mistake on my part - I forgot to include the
power() function in the source. It works fine now.
Ben Pfaff wrote:
> Ari Pollak <compwiz@bigfoot.com> writes:
>
> > Before you dismiss this as a complete newbie question, please read on.
> > The small program that I compiled has all the necessary header files
> > included (math.h), and it refers to the power() function inside a
> > function called prn_tbl_of_powers(). power is defined at the beginning
> > of the program, with:
> >
> > long power(int, int);
>
> That's not a definition, that's a prototype. Unless you actually
> provided a definition of power() otherwise, I'm not surprised
> that you're having trouble: power() is not the name of a standard
> ANSI C function.
>
> Why can't you just use pow()?
--
___ ___
/ _ | / _ \ Ari Pollak - compwiz@bigfoot.com - www.compwiz.nu
/ __ |/ ___/ ICQ #749825 - AOL IM: aripollak
/_/ |_/_/ Make it idiot proof and someone will make a better idiot.