c语言调用c++库的头文件


#ifndef OBJECT_DETECT_H
#define OBJECT_DETECT_H 
#include <stdbool.h>
/*************************************************
功能: 对象检测(检测视频中的台标、人物等)
参数说明:
src             :输入图像数据(YUV420P)
srcStride       :输入数据的长度
image_width     :输入图像宽度
image_height    :输入图像高度
model_path      :对象检测模型的路径(.pb)
pbtxt_path      :模型对应的描述文件(.pbtxt 需通过opencv-4.2.0/sample/dnn/tf_text_graph_ssd.py进行生成)
object_name_path:对象id到名称的映射
min_match_rate  :最小匹配率
show            :是否显示检测到的结果
**************************************************/
#ifdef __cplusplus
extern "C"{
#endif
bool object_detect(unsigned char* src[8], int srcStride[8],int image_width,int image_height,char* model_path,char* pbtxt_path,char *object_name_path,float min_match_rate,bool show);
#ifdef __cplusplus
}
#endif
#endif

以上是库文件对应的头文件,头文件必须有extern c 才能被C调用

[root@node0 lib_object_detect]# nm object_detect.so |grep object_detect
000000000001249e t _GLOBAL__sub_I_object_detect.cpp
0000000000010203 T object_detect
000000000021de30 b _ZGVZ13object_detectE8kWinName
0000000000017e08 r _ZZ13object_detectE8__func__
000000000021de48 b _ZZ13object_detectE8kWinName
[root@node0 lib_object_detect]# ls
Makefile  object_detect.cpp  object_detect.h  object_detect.so  test.cpp

nm的符号中必须有object_detect才行,切object_detect前不能有其他字符


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM