错误:在此范围内未声明“ numeric_limits”
Error: ‘numeric_limits’ was not declared in this scope
我正在编译下载的代码。在使用cmakelist制作文件时,我会在这一行中遇到以下错误:
VocTree::findPath(Mat &descriptor) {
list<int> path;
int idNode = 0;
unsigned int numCh = _k;
path.push_back(idNode);
while (!isLeaf(idNode)) {
//Search the closest sub-cluster
int idClosest = 0;
double minDist = numeric_limits<int>::max();
for (size_t i = 0; i < numCh; i++) {
int childId = idChild(idNode, i);
int idxChild = _index[childId];
double d = norm(descriptor, _centers.row(idxChild), _useNorm);
if (i == 0 || d < minDist) {
minDist = d;
idClosest = childId;
}
}
idNode = idClosest;
path.push_back(idNode);
}
return path;
}
这是错误:
src/VocTree.cpp:872:26: error: ‘numeric_limits’ was not declared in this scope
double minDist = numeric_limits<int>::max();
^
src/VocTree.cpp:872:41: error: expected primary-expression before ‘int’
double minDist = numeric_limits<int>::max();
已经使用了以下名称空间:
using namespace cv;
using namespace std;
您需要包括
#include <limits>
相关文章:
- <limits> 使用 VSC2019 编译旧代码时出错
- 为什么在main()之前断言会导致语法错误"error: expected ')' before numeric constant"?
- limits.h中未确认的值
- OpenCV make error: limits.h 没有这样的目录文件
- boost::icl::interval 和 boost::numeric::interval 是否有可用的适配层?
- 在没有 <limits.h> 或 <values.h> 的系统上查找SHRT_MAX
- 检测<T>某些非数字类型 T 的 std::numeric::type 的特化
- 是否有内置函数可用于boost :: numeric ::间隔
- 使用 boost::numeric::odeint 积分非线性函数 f'(x, y, z) = a + b*I
- 模板实例化与Armadillo和Boost :: Numeric :: Odeint
- typedef 一个向量和 boost::numeric::ublas::vector 的固定大小
- 如何在没有 #include 的情况下获得DBL_MIN <limits> C++
- 为什么Boost Numeric库通过使用调试或发布模式给出不同的结果
- 从另一个子向量或subsatrix创建boost :: numeric :: ublas vector
- 包含 boost::numeric::ublas::matrix 的类的运算符重载
- GMOCK 叮当讨厌的错误"/usr/include/limits.h:123:16: fatal error: 'limits.h' file not found"
- Visual Studio malloc limits
- 当我<limits>在 c++ 代码中包含或<limit.h>时有什么区别
- 与CUDA/OpenMP兼容的`boost::numeric::odeint::runge_kutta-X`模板参数
- Limits of BOOST_FUSION_ADAPT_STRUCT