这个问题在这里已经有了答案:std::expfandstd::logfnotrecognizedbygcc7.2.0(3个回答)关闭3年前。根据这里的讨论,我有reportedabug给Ubuntu开发者。在编译以下示例c++程序时:#include#includeintmain(){printf("%f\n",std::cosf(0.0f));}我收到以下错误消息:error:‘cosf’isnotamemberof‘std’包括math.h并使用非命名空间版本可以正常工作。怎么回事?我在Ubuntu19.04上使用g++8.3.0-6ubuntu1。我正在使用g++--std=c+