Re: #include <math.h>
From: Dan Pop (Dan.Pop_at_cern.ch)
Date: 11/25/03
- Next message: Dan Pop: "Re: [OT] Indian C programmers and "u""
- Previous message: Dan Pop: "Re: #include <math.h>"
- In reply to: Kelsey Bjarnason: "Re: #include <math.h>"
- Next in thread: gswork: "Re: #include <math.h>"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Nov 2003 16:46:27 GMT
In <pan.2003.11.25.02.05.07.387424@lightspeed.bc.ca> Kelsey Bjarnason <kelseyb@lightspeed.bc.ca> writes:
>On Mon, 24 Nov 2003 16:52:07 -0800, Darius Fatakia wrote:
>
>> I seem to be having trouble with some of my math functions (pow, sqrt,
>> acos). They're the only ones I use in my code and they prevent the program
>> from compiling. I get a "undefined reference to 'pow'" error. Here is the
>> relevant portion of my code.
>
>Sounds like a linker error - are you linking the math libraries? There's
>a certain, popular compiler, especially widely used in the Linux world,
>which has the terminally brain-dead habit of not including the math
>libraries by default. Assuming you're using this compiler, try something
>like this:
>
>gcc -lm file.c
gcc merely follows the common Unix convention, established by a certain
Dennis M. Ritchie.
Dan
-- Dan Pop DESY Zeuthen, RZ group Email: Dan.Pop@ifh.de
- Next message: Dan Pop: "Re: [OT] Indian C programmers and "u""
- Previous message: Dan Pop: "Re: #include <math.h>"
- In reply to: Kelsey Bjarnason: "Re: #include <math.h>"
- Next in thread: gswork: "Re: #include <math.h>"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|