GCC and math.h problem
I have just started programming in linux and I am porting some of my software. I need to use the math functions. I was getting errors about "undefined reference sqrt" when compiling with gcc.
I thought it was something wrong with my code, so I checked the man pages for ''sqrt'' and made a small test program which has the same error.
#include
int main ()
{
double test_var;
test_var = sqrt(3.00f);
return 0;
}
I used this line to compile the file:
gcc -o test test.c
I am using Mandrake 8.1, gcc 2.9.6 and glibc 2.2.4
I am I missing something?
thanks in advance for any help!
make sure the function is declared in "math.h" and that you are binding "glibc" correctly and it contains the "sqrt" function definition.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement