本地环境:
VS2022
安装的NuGet包:Eigen版本3.3.9
配置MKL

头文件相关代码

#include <cmath>
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
void ComputeTest();
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.

源文件相关代码

#define EIGEN_USE_MKL_ALL
#define EIGEN_VECTORIZE_SSE4_2
#include <iostream>
#include <Eigen/Eigen>
#include <unsupported/Eigen/Polynomials>
#include "ExtractCalculate.h"
Eigen::PolynomialSolver<double, Eigen::Dynamic> solver; //solving the roots of polynomial equations
Eigen::VectorXd test(3);

void ComputeTest()
{
	test[0] = 1;
	test[1] = 2;
	test[2] = 1;
	solver.compute(test);//代码在此处报错
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.

报错信息:

求助!C++使用Eigen求多项式根报错访问冲突_#include

打断点调式,问题定位到下方代码后再单步调试我就看不懂了

求助!C++使用Eigen求多项式根报错访问冲突_#define_02


再之后就是

求助!C++使用Eigen求多项式根报错访问冲突_#include_03

我现在面对访问冲突这个报错毫无头绪,请问我下一步应该在做点什么呢