python_调用c,c++模块
来源:互联网 发布:淘宝自然搜索排名 编辑:程序博客网 时间:2024/06/06 09:02
参考:http://blog.sina.com.cn/s/blog_6982136301010rsj.html
//testc.c//gcc -o testc.so -shared -fPIC testc.c#include <stdlib.h> int foo(int a, int b) { printf("this is c so Your input %i and %i\n", a, b); return a + b; }
//testcpp.cpp//g++ -o testcpp.so -shared -fPIC testcpp.cpp#include<iostream>using namespace std;void foo2(int a,int b){cout<<"this is cpp so"<<a<<" "<<b<<endl;}//以下为必须extern "C"{void cfoo2(int a,int b){foo2(a,b);}}
#test.py#python test.pyimport ctypes ll = ctypes.cdll.LoadLibrary libc = ll("./testc.so") libcpp = ll("./testcpp.so")libc.foo(1, 2)libcpp.cfoo2(1, 3)
- python_调用c,c++模块
- lua 调用c模块
- lua调用c模块
- PYTHON 调用 C/C++模块
- c语言调用汇编模块
- Lua 调用自定义C模块
- Lua 调用自定义C模块
- C 模块调用C++ 编写模块
- C 模块调用 C++ 编写模块
- C调用python,如何调用pymongo模块
- python_模块
- Python_模块
- python调用C模块的方法
- keil C调用汇编模块的例子
- C#中简单调用c/c++模块
- Python使用bitey调用C模块
- Python与C/C++ 模块相互调用
- Python与C/C++ 模块相互调用
- 关于把button加到UIImageView上后button无法响应单击事件的方法
- Spring JMS应用
- Android makefile 组织结构
- 通过命令行创建Android工程,并编译发布
- Linux下忽略大小写查找的方法
- python_调用c,c++模块
- Objective-C语法快速参考(语法速成)
- uva 10167 Birthday Cake
- Qt 5.x设置透明背景
- RHEL 6系统启动时盘符漂移、竞争
- QT动画介绍
- .net日历控件 Calendar选择多个日期
- 分析 TextView 应用 Spannable 风格后 ellipsize 属性失效
- 根据wsdl文件生成服务端代码