#问题现状:
使用Visual studio编辑C++代码,并生成DLL动态链接库发送到模型软件中做外部控制器,此时可以正常使用;
在C++代码中增加关于EIGEN库的内容,生成DLL送进模型中运算就报错了。
#include <stdio.h>
#include <string.h>
#include <Eigen/Dense>
#include <iostream>
using namespace std;
#define NINT(a) ((a) >= 0.0 ? (int)((a)+0.5) : (int)((a)-0.5))
extern "C" //avoid mangled names
{ void __declspec(dllexport) __cdecl DISCON(float* avrSwap, int* aviFail,
char* accInfile, char* avcOutname, char* avcMsg);
}
//Main DLL routine
void __declspec(dllexport) __cdecl DISCON(float* avrSwap, int* aviFail, char* accInfile, char* avcOutname, char* avcMsg)
{
Eigen::MatrixXd M;
M << 0, 0,
0, 0;
std::cout << M << std::endl;
return;
}