0

我正在尝试做这种类型的声明(我是 C++ 的新手):

// Fixed Sized Matrix: you know what is the size of the matrix
#include <Eigen/Dense>
static int rows = 5, cols = 6;
Matrix<float, rows, cols> f1;
std::cout << "matrix f1: [" << f1 << "]" << std::endl;

但我收到一个错误:

严重性代码描述项目文件行抑制状态错误 C2975 '_Rows':'Eigen::Matrix' 的模板参数无效,预期的编译时常量表达式 readEigenMatrix C:\Users\xxxxxx\repos\readEigenMatrix\main.cpp 87

...对不起,如果我问的是一个微不足道的问题。
4

0 回答 0