I encountered this error while trying to build a cpp project using CLion. Here is the error message:
/usr/include/c++/5/cmath:102:11: error: ‘::acos’ has not been declared
using ::acos;
^
/usr/include/c++/5/cmath:121:11: error: ‘::asin’ has not been declared
using ::asin;
^
/usr/include/c++/5/cmath:140:11: error: ‘::atan’ has not been declared
using ::atan;
^
/usr/include/c++/5/cmath:159:11: error: ‘::atan2’ has not been declared
using ::atan2;
^
/usr/include/c++/5/cmath:180:11: error: ‘::ceil’ has not been declared
using ::ceil;
^
/usr/include/c++/5/cmath:199:11: error: ‘::cos’ has not been declared
using ::cos;
...
In the project, there is a custom header file called ~/someproject/src/math.h
. Changing the ~/someproject/src/math.h
file name to a non-conflicting name such as math1.h
(and updating its references accordingly) resolves the error.
Does anybody know of another solution to this that does not require a name change?