Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Lillemanden

What up with std::sqrt()?

This topic is 5195 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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".

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
You can hack around it by doing something like


namespace std
{
using ::sqrt;
}


in the cmath header

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!