Problem with pow()

This is a discussion on Problem with pow() within the C Programming forums, part of the General Programming Boards category; Hello all, I get this error message when I compile my program: ld: unresolved: pow I had checked all my ...

  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,267
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,340
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 10: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, 05:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21