我正在为ac#项目使用C++框架并使用swig连接它们.
TypeInitializationException每次我尝试创建C++对象包装器时都会抛出问题.
C#代码
TRPoint p = new TRPoint();
Run Code Online (Sandbox Code Playgroud)
其中TRPoint是C++结构
typedef struct {
float x, y;
} TRPoint;
Run Code Online (Sandbox Code Playgroud)

细节:

我有一个vc项目,将c ++代码构建到DLL文件中,但我不知道如何正确链接它.