What up with std::sqrt()?
Hey.
I''m trying to use std::sqrt(), I have tried both #include <cmath> #include <math.h>. I don''t get any error such file not found, but when I try to compile anything with std::sqrt() in it I get a "error C2039: ''sqrt'' : is not a member of ''std''". I''m using VC++ 6.
I of cause have a number inside the (). VC++ 6 will however in the list of std members (showing as soon as I write the second '':'') show "sqrt".
VC++6 had a bug in its standard library where functions such as sqrt(), that were supposed to be in the std namespace, weren''t. Just use the one from the global namespace.
"Sneftel is correct, if rather vulgar." --Flarelocke
"Sneftel is correct, if rather vulgar." --Flarelocke
You can hack around it by doing something like
in the cmath header
namespace std{using ::sqrt;}
in the cmath header
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement