Re: [CODE] Please help me with pow()

From: Christian Loth (chris@gidayu.max.uni-duisburg.de)
Date: 08/02/00


Greetings,

On Wed, Aug 02, 2000 at 12:21:40PM +0100, Jake Turner wrote:
> Hi,
>
> I recently added some complicated maths stuff to figure out exp
> for mobs automatically.  I did this on windows in MSVC6 and in places
> had to use the..
>
> double pow(double _X, double _Y);
>
> function. This was working fine until I uploaded the code to unix where i
> got the..
>
> /home/portloe/circle/src/db.c:1702: undefined reference to `pow'
> /home/portloe/circle/src/db.c:1704: undefined reference to `pow'
>
> errors. This is because I havn't linked in the right libraries right?
> If so could someone please tell me which libraries to include and how to
> include them, or if that isnt the case how I can ammend this problem? :)

Yep, you're right. Simply check your Makefile where your executable
is linked, and add the "-lm" parameter. (libm.a or libm.so is the
lib that includes the math functions).

- Chris

--
Christian Loth
Coder of 'Project Gidayu'
Computer Science Student, University of Dortmund
chris@gidayu.mud.de - http://gidayu.mud.de


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT