ShiqiYu / libfacedetection

An open source library for face detection in images. The face detection speed can reach 1000FPS.
Other
12.28k stars 3.05k forks source link

Java JNA 调用失败 #46

Closed wellpeng closed 5 years ago

wellpeng commented 7 years ago

当使用 JNA 调用时,由于头文件 __declspec(dllexport) 时没有 extern "C" 而导致无法调用 dll 的函数。 当定义了之后,如果没有 #define FACEDETECTDLL_EXPORTS 也会导致无法调用。

wellpeng commented 6 years ago

搞定,自己封装了个 dll 来调用于老师的 dll,用查看 dll 依赖的工具(dependency walker)找出了函数签名,然后用 JNI 来调用。不依赖 demo 中的 opencv mat 来灰度化图片,而是 Java 重写了图片灰度化方法来获取字节。有需要的同学可以 email 我。

wangwang194 commented 6 years ago

你好,我想问一下,在封装的时候出现 错误 13 error LNK2001: 无法解析的外部符号 "declspec(dllimport) int * cdecl facedetect_multiview_reinforce(unsigned char ,unsigned char ,int,int,int,float,int,int,int,int)" (_imp?facedetect_multiview_reinforce@@YAPAHPAE0HHHMHHHH@Z) E:\workspace\opencv\2017.11.24\Client\Client\ImageProcess.obj Client 这种怎么解决,lib已经添加了,但是不知道是哪个地方出现问题?