我正在尝试通过运行包附带的测试代码来测试 Eigen 的非线性优化功能。
我对这些错误感到困惑(更像是困惑):
Error 5 error C2039: 'please_protect_your_min_with_parentheses' : is not a member of 'std::numeric_limits<double>' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\eigen-eigen-5097c01bcdc4\unsupported\eigen\src\nonlinearoptimization\lmpar.h 184
Error 7 error C2039: 'please_protect_your_min_with_parentheses' : is not a member of 'std::numeric_limits<double>' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\eigen-eigen-5097c01bcdc4\unsupported\eigen\src\nonlinearoptimization\lmpar.h 28
Error 6 error C2065: 'please_protect_your_min_with_parentheses' : undeclared identifier c:\program files (x86)\microsoft sdks\windows\v7.0a\include\eigen-eigen-5097c01bcdc4\unsupported\eigen\src\nonlinearoptimization\lmpar.h 184
Error 8 error C2065: 'please_protect_your_min_with_parentheses' : undeclared identifier c:\program files (x86)\microsoft sdks\windows\v7.0a\include\eigen-eigen-5097c01bcdc4\unsupported\eigen\src\nonlinearoptimization\lmpar.h 28
顺便说一下(我认为)导致这种情况的线路是这样的:
#define min(A,B) please_protect_your_min_with_parentheses
并且错误指的是这一行(在上面提到的 2 个不同的地方,即第 28 行和第 184 行):
const Scalar dwarf = std::numeric_limits<Scalar>::min();
任何建议都将不胜感激