I am trying to build a c++ dll using visual studio and load this dll in python. The dll code
#define DLLEXPORT extern "C" __declspec(dllexport)
#include "test.h"
#include "opencv2\\highgui.hpp"
using namespace cv;
DLLEXPORT int sumV() {
Mat a = Mat::zeros(5,5, CV_8U);
return 11;
}
and python code is
from ctypes import *
from ctypes.util import *
dll = find_library('C:\\path\\dll1.dll')
lib = cdll.LoadLibrary(dll)
I always got "OSError: [WinError 126] The specified module could not be found." when I run the python code.
Does anyone know how to solve this problem? thanks a lot.