C++ Interop - writing a shim to use an existing c++ library [Answered]
So I'm currently trying to make a shim for a C++ library that I can then call from C#.
The original library uses CMake, not MSBuild, so I've set up Cmake, let it generate the .vcxproj files, made a 2nd C++ project for my shim classes and made it depend on the generated projects.
Then I've added that + the generated projects into my C# msbuild solution.
Now I am trying to call a hello world function that I made in my shim library form C#, but that immediately fails with no indicator as to what went wrong. all I get is
How I declared it on the C++ side:
How I declared it on the C# side:
any help appreciated!
The original library uses CMake, not MSBuild, so I've set up Cmake, let it generate the .vcxproj files, made a 2nd C++ project for my shim classes and made it depend on the generated projects.
Then I've added that + the generated projects into my C# msbuild solution.
Now I am trying to call a hello world function that I made in my shim library form C#, but that immediately fails with no indicator as to what went wrong. all I get is
System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'.How I declared it on the C++ side:
How I declared it on the C# side:
any help appreciated!
