jna调用c++的dll,dll中函数入参为std::String 该如何模拟(附接口代码)
class Detector {
public:
Detector(std::string cfg_filename, std::string weight_filename, int gpu_id = 0);
~Detector();
std::vector<bbox_t> detect(std::string image_filename, float thresh = 0.2, bool use_mean = false);
std::vector<bbox_t> detect(image_t img, float thresh = 0.2, bool use_mean = false);
static image_t load_image(std::string image_filename);
static void free_image(image_t m);
#ifdef OPENCV
std::vector<bbox_t> detect(cv::Mat mat, float thresh = 0.2, bool use_mean = false);
#endif
};
如上,我想在java中利用jna使用这个dll,
JNATestDll instanceDll = (JNATestDll)Native.loadLibrary("D:\\BaiduNetdiskDownload\\darknet-master\\darknet-master\\build\\darknet\\x64\\yolo_cpp_dll.dll",JNATestDll.class);
void Detector(String cfg_filename, String weight_filename, int use_mean);
出错如下
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'Detector': 找不到指定的程序。