Thread overview | |||||
---|---|---|---|---|---|
|
September 01, 2007 std::sqrt() with a double argument gives an error | ||||
---|---|---|---|---|
| ||||
The following code gives an error: #include <cmath> int main() { std::sqrt(10.0); } int main() { std::sqrt(10.0); } ^ Error: ambiguous reference to symbol Had: std::_inline_sqrt(float ) and: std::_inline_sqrt(long double ) --- errorlevel 1 It works fine if I use sqrt() instead of std::sqrt(), or if I use a float or long double value, e.g. std::sqrt(10.0f) I have stared at math.h for some time but I could not figure out what the difference between std::sqrt() and sqrt() is (or where std::sqrt() is defined). Could someone please take a look at this and show me what to change in the library headers to make it work? Szabolcs |
September 01, 2007 Re: std::sqrt() with a double argument gives an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sz. Horvát | OK, I'm stupid, I should have looked at STLport's cmath, not at dmc's. I also found the previous posts about this. |
March 22, 2009 Re: std::sqrt() with a double argument gives an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sz. Horvát | use return 0; |
Copyright © 1999-2021 by the D Language Foundation