TypeInitializationException when using swig for C #

I use the C ++ framework for a C # project and using swig to connect them.

The problem is that a TypeInitializationException is thrown every time I try to create a wrapper on a C ++ object.

C # code

 TRPoint p = new TRPoint(); 

where TRPoint is a C ++ structure

 typedef struct { float x, y; } TRPoint; 

enter image description here

Details:

enter image description here

I have a vc project that builds C ++ code in a DLL file, but I do not know how to properly link it.

+6
source share
1 answer

The exception means β€œit is impossible to load the DLL” - it looks like you did not create C ++ code that generates SWIG, or perhaps got the path if it was built.

+3
source

Source: https://habr.com/ru/post/906049/


All Articles