ShiqiYu / libfacedetection

An open source library for face detection in images. The face detection speed can reach 1000FPS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

facedetection_export.h这是个什么东西0.0

SiyerBOBO opened this issue · comments

facedetectcnn.h在这个头文件中包含了facedetection_export.h库,但是在您的源码根目录中我没有找到它,烦请解释一下,谢谢

You can remove that line.

@KangLin Can you help to explain?

Thank you~(^-^)I can now compile it normally

@SiyerBOBO 您好请教一下,我运行程序,遇到这个问题,“facedetect_cnn”: 找不到标识符,您知道是什么原因吗?

commented

facedetection_export.h 是运行cmake之后产生出来的,包含了一些选项,包括是否使用AVX2、AVX512指令集等等。
如果是用编译好的 shared library(动态链接库),找不到标识符可能是因为facedetect_cnn函数定义前没加上extern "C"。
我C++不熟,如有说错的还请指正。

1、facedetection_export.h 是运行cmake之后产生出来的,主要是针对 windows DLL 导出函数。它申明了 FACEDETECTION_EXPORT 。
2、windows dll 导出函数需要 __declspec(dllexport) 声明,只有声明后,函数才会从DLL中导出,未声明的函数,做为DLL的私有函数,是不会从DLL中导出的(你可以把DLL看成class, __declspec(dllexport) 看成 public) 。当其它程序引用时,需要 __declspec(dllimport) 声明。
3、extern "C" 是用来指示C++函数编译时,用C格式修饰。 C++ 与 C 语言在编译时,函数修饰的格式是不一样的,为了能使C语言调用C++函数,所以需要加extern "C"

我建议使用库的形式使用本项目,不要使用源码形式。当你需要在其它项目中以源码形式使用 libfacedectection 时,需要定义 FACEDETECTION_EXPORT 宏:你可以使用下列方法之一:
1、先编译本项目,然后把生成的 facedetection_export.h 和源码一起复制到其它项目。
2、增加 facedetection_export.h 文件,在其中定义宏 FACEDETECTION_EXPORT
#define FACEDETECTION_EXPORT

Hi everyone, I can't find facedetection_export.h here.
Please, can you help me find the file to compile and run it?