Functions from <cmath> not resolved

Hi,

I need to use math functions like exp, log and sqrt from the cmath header in some numerical code I'm writing. The code compiles fine in Clion, but the IDE shows the cmath include greyed out as unused and calls to the above functions are marked as 'Can't resolve'.

This is a standard header and clearly it is found because the actual build works fine, but the constant pop-ups are somewhat annoying. Is there anything I can do about this?

0

Hi Erik.

Could you please specify your OS and send idea.log (Help | Show Log in ...) to clion-support at jetbrains.com. Also please try invalidating caches via 'File | Invalidate Caches / Restart'. Does that help?

0
Avatar
Permanently deleted user

I have the exact same issue. Invalidating caches does not help, and I have sent a copy of my log to the support email.

To reproduce, install the latest version of mingw-w64, configure CLion to use it, and make a new C++ project with the following code:

#include <cmath>
#include <iostream>
 
int main() {
    std::cout << "Square root of 0.04 is " << sqrt(0.04) << std::endl;
    return 0;
}
 
The incorrect warning will then pop up.
0

请先登录再写评论。