Part of the source code:
double _Complex z = 1.0 + 1.0*I;
printf("%f\n", cabs(z));
My development environment: Ubuntu16.04LTS, Clion IDE with GCC version 5.4.0, C11 standard.
As I run the code, an error occurs with message
undefined reference to `cabs'
The IDE tells me that the function cabs
is declared in the header file cmathcalls.h
, so I try to:
#include<cmathcalls.h>
But the IDE warns me that the file cannot be found, so again I try:
#include<bits/cmathcalls>
The I run the code, however it still doesn't work.
I want to know how can I get the abs value of the complex z
with the function cabs
?