Thread: What was the library for math.h functions?

  1. #1
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733

    Question What was the library for math.h functions?

    I tried "-lmath" but that didn't work out, tried looking for it via google but who'd of thought that even the official docs don't even mention it let alone every other link I tried be it a guide or something else

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Try -lm
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    Thanks I now have lu compiled for usage with other projects of mine, I'll upload the changes later after work, prob 2mw morning

  4. #4
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,111
    Quote Originally Posted by awsdert View Post
    I tried "-lmath" but that didn't work out, tried looking for it via google but who'd of thought that even the official docs don't even mention it let alone every other link I tried be it a guide or something else
    From man 3 pow (Just one of the functions available from the math library):
    POW(3) Linux Programmer's Manual POW(3)

    NAME
    pow, powf, powl - power functions

    SYNOPSIS
    #include <math.h>

    double pow(double x, double y);
    float powf(float x, float y);
    long double powl(long double x, long double y);

    Link with -lm.
    ...
    The man system is the programmers friend! ;^)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. math.h library not working with curses.h
    By John McPherson in forum C Programming
    Replies: 4
    Last Post: 06-15-2017, 12:39 PM
  2. Replies: 7
    Last Post: 01-12-2013, 05:07 PM
  3. Library for math strings
    By Boomba in forum C Programming
    Replies: 4
    Last Post: 10-15-2005, 08:05 PM
  4. Basic Math Problem. Undefined Math Functions
    By gsoft in forum C Programming
    Replies: 1
    Last Post: 12-28-2004, 03:14 AM
  5. math library
    By Eber Kain in forum C++ Programming
    Replies: 3
    Last Post: 06-16-2004, 01:11 AM

Tags for this Thread