Thread: Problem with pow()

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    3

    Problem with pow()

    Hello all,

    I get this error message when I compile my program:

    ld:
    unresolved:
    pow

    I had checked all my variables and hard coded values into the pow() function to see if it is working. I also created a test program to test the pow() function but no luck.

    Any ideas on the causes of this message??

    Thanks in advance!

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    i assume from the error message youve included math.h so you need link to this library LIBC.LIB
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    3
    thanks for the reply.

    Could you show the syntax for it?? Would it be placed with the preprocessor directives?

    My textbook does not show a 'libc.lib'. Just a #include <math.h>

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Try
    &nbsp; gcc prog.c -lm
    to specify that you want to link in the math library
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    3
    That did it!! Thanks for all the help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM