B
bobrics
Hi,
I have been trying to compile some source code that is supposed to be
working and getting some compilation errors. The errors are with
sqrt(), log() and round() functions. I have math.h included and made
sure it's in the path. I have read on the forums that some have fixed
the problem by telling GCC to link math libraries if it's not done by
default.
So, using gcc -lm helped to resolve the problems with defining the
first two functions. However, round() is still undefined: "undefined
reference to round()"
Another suggestion that I have found is to check whether the compiler
is using C99 VS C90 library. This is quite stange that I have faced
these problems while using GCC 4.0.2.
What do you think about this? Why is this a problem? As far as I
understood, round() has been defined in C99 and gcc 4.0.2 should have
come with C99 libraries.
Thank you
I have been trying to compile some source code that is supposed to be
working and getting some compilation errors. The errors are with
sqrt(), log() and round() functions. I have math.h included and made
sure it's in the path. I have read on the forums that some have fixed
the problem by telling GCC to link math libraries if it's not done by
default.
So, using gcc -lm helped to resolve the problems with defining the
first two functions. However, round() is still undefined: "undefined
reference to round()"
Another suggestion that I have found is to check whether the compiler
is using C99 VS C90 library. This is quite stange that I have faced
these problems while using GCC 4.0.2.
What do you think about this? Why is this a problem? As far as I
understood, round() has been defined in C99 and gcc 4.0.2 should have
come with C99 libraries.
Thank you