I need to work with OpenMesh on my PC with Qt IDE, the snip of the simple *.pro file looks like:
DEFINES += _USE_MATH_DEFINES
DEFINES += NOMINMAX
#DEFINES += OM_STATIC_BUILD
#OpenMesh
INCLUDEPATH += "D:/Libraries/OpenMesh 6.3/include"
#Debug
LIBS += "D:/Libraries/OpenMesh 6.3/lib/OpenMeshCored.lib"
LIBS += "D:/Libraries/OpenMesh 6.3/lib/OpenMeshToolsd.lib"
# Release
LIBS += "D:/Libraries/OpenMesh 6.3/lib/OpenMeshCore.lib"
LIBS += "D:/Libraries/OpenMesh 6.3/lib/OpenMeshTools.lib"
However, I still got the error message: "C1189: #error: "You have to define _USE_MATH_DEFINES in the compiler settings!" Can anyone help me?
The same error occured to me, but with MSVC 2019 16.6.1
Adding the define _USE_MATH_DEFINES in front of my OpenMesh include statement solves the problem for me.
The forum Post How does #define _USE_MATH_DEFINES work? helped me to understand the functionality behind the define.