C调用C++函数
来源:互联网 发布:sd卡数据恢复软件 编辑:程序博客网 时间:2024/06/05 00:18
#ifdef _cplusplus
extern "C"
{
#endif
int myfunc();
#ifdef __cplusplus
}
#endif
在 cpp文件中:
需要:
extern "C" int myfunc(){}
接下来,将cpp文件编译成.o文件,如:g++ -c detect.cpp detect.o
最后将多个.o文件编译成一个.a文件,如ar cr detect.o lan.o libtest.a
在makefile文件中添加对.a的链接,如XLIB -ltest
阅读全文
0 0
- 调用C函数
- C调用汇编函数
- C函数调用机制
- C 函数调用测试
- Lua调用C函数
- C函数调用约定
- C++调用c函数
- c调用C++函数
- C函数调用方法
- lua 调用c函数
- C++调用C函数
- C++调用C函数
- C函数调用机制
- Python 调用 C函数
- C++调用C函数
- C函数调用
- c 函数调用方式
- C函数调用过程
- Fast convolutional neural network training using selective data sampling 笔记
- HTML-0907总结
- linux命令--解压缩(归档)命令
- Leetcode #14. Longest Common Prefix
- 安卓系统下生成QR码(二)——自定义二维码的纠错等级
- C调用C++函数
- HashMap学习心得
- 信息?学习?
- python3 位类动态添加方法 import types x=types.MethodType(要添加的方法名,对象名)
- bzoj1197:[HNOI2006]花仙子的魔法
- java.io.IOException Server returned HTTP response code 415
- 黑板客 -- 爬虫闯关 -- 关卡03
- HDU1021 水题
- eclipse中无法查看jdk debug变量的值