【发布时间】:2020-03-10 01:54:41
【问题描述】:
根据cppreference,函数acosl应该在std命名空间中:https://en.cppreference.com/w/cpp/numeric/math/acos
但是,使用 gcc(或 clang),下面的代码无法编译:
#include <cmath>
int main()
{
long double var = std::acosl(4.0);
return 0;
}
我收到以下错误消息:
gay@latitude-7490:~$ g++ -std=c++11 test.cpp
test.cpp: In function 'int main()':
test.cpp:5:26: error: 'acosl' is not a member of 'std'; did you mean 'acosh'?
5 | long double truc = std::acosl( (long double)4.0);
| ^~~~~
| acosh
我错过了什么?我误读了 cppreference 吗?
【问题讨论】: