libfacedetection icon indicating copy to clipboard operation
libfacedetection copied to clipboard

facedetection_export.h这是个什么东西0.0

Open SiyerBOBO opened this issue 4 years ago • 8 comments

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

SiyerBOBO avatar Mar 17 '20 05:03 SiyerBOBO

You can remove that line.

@KangLin Can you help to explain?

ShiqiYu avatar Mar 17 '20 09:03 ShiqiYu

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

SiyerBOBO avatar Mar 17 '20 09:03 SiyerBOBO

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

infrontofme avatar Mar 24 '20 15:03 infrontofme

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

zhuth avatar Mar 24 '20 22:03 zhuth

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 avatar Mar 24 '20 23:03 KangLin

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

KangLin avatar Mar 24 '20 23:03 KangLin

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

nminhchau avatar Jun 11 '22 12:06 nminhchau

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: @.***>

KangLin avatar Jun 14 '22 01:06 KangLin