I'm trying to compile a library in C++ as dll windows with visual studio 2017.
I have all C++/H compiled with clang 3.8 for android and it works.
I created a new project as dynamic library with LLVM as platform toolset. Now I'm trying to build but there is an error :
Error C2065 'M_PI': undeclared identifier
This error is present in many .cpp files. All linked .h contains :
#include <cmath>
I replaced by :
#define _USE_MATH_DEFINES // for C++
#include <cmath>
But it change nothing. What can I do ?
This is a known issue, try defining _USE_MATH_DEFINES
as a definition in your project properties instead of the file itself.
This can be found in project properties -> C/C++ -> Preprocessor -> Preprocessor definitions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With