ShiqiYu / libfacedetection

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

facedetection_export.h这是个什么东西0.0 #222

Open SiyerBOBO opened 4 years ago

SiyerBOBO commented 4 years ago

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

ShiqiYu commented 4 years ago

You can remove that line.

@KangLin Can you help to explain?

SiyerBOBO commented 4 years ago

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

infrontofme commented 4 years ago

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

zhuth commented 4 years ago

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

KangLin commented 4 years ago

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"

KangLin commented 4 years ago

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

define FACEDETECTION_EXPORT

nminhchau commented 2 years ago

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

KangLin commented 2 years ago

This file is produced by the CMAKE configure phase. please learn cmake.

At 2022-06-11 20:02:10, "MChau2402" @.***> wrote:

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

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>