I have a C# code to test the import of the DLL. Cleaning the C++ solution helped when im not calling OpenCV modules but as soon as I try to initialize the Mat, it doesn't work anymore. I added every .dll from opencv (calib3d.dll, core.dll, ....)
C# code:
[DllImport("Project1")]
internal static extern void processData(byte[] data, uint width, uint height);
public static void test(byte[] data, uint width, uint height)
{
processData(data, width, height);
}
C++ Project1.dll Code:
using namespace std;
using namespace cv;
extern "C" void __declspec(dllexport) __stdcall processData(unsigned char* data, unsigned int width, unsigned int height) {
unsigned int cols = width;
unsigned int rows = height;
Mat datamat = Mat(rows, cols, CV_8UC3);
}
Error message (german):
Ausnahme ausgelöst: "System.DllNotFoundException" in DllTest.exe
Unable to load DLL 'Project1': Das angegebene Modul wurde nicht gefunden. (Exception from HRESULT: 0x8007007E)
User contributions licensed under CC BY-SA 3.0