代码收藏家 技术教程 2024-05-31 Python 如何调用动态链接库 DLL/SO 的方法 文章目录 一、linux环境 1.函数编写 2.编译为动态链接库so 3.使用python调用 4.检查动态链接库中的符号表 5.添加extern “C”防止函数名被编译器修饰 二、Windows环境 1.编写test.cpp 2.编译test.dll 3.在python中调用 4.运行结果 可以看到输出了1+3的结果:  一、linux环境 1.函数编写 编写一个简单的示例代码,用于进行简单的加法运算 #include <stdio.h> // 一个简单的函数,将两个整数相加 int add(int 作者:flyingrtx Linux python Python windows 物联沃分享整理物联沃-IOTWORD物联网 » Python 如何调用动态链接库 DLL/SO 的方法
网站防火墙 *{margin:0;padding:0;color:#444} body{font-size:14px;font-family:”宋体”} .main{width:600px;margin:10% auto;} .title{background: #20a53a;color: #fff;font-size: 16px;height: 40px;line-height: 40px;padding-left: 20px;} .content{background-color:#f3f7f9; height:280px;border:1px dashed #c6d9b6;padding:20px} .t1{border-bottom: 1px dashed #c6d9b6;color: #ff4000;font-weight: bold; margin: 0 0 20px; padding-bottom: 18px;} .t2{margin-bottom:8px; font-weight:bold} ol{margin:0 0 20px 22px;padding:0;} ol li{line-height:30px} 网站防火墙 您的请求带有不合法参数,已被网站管理员设置拦截! 可能原因: 您提交的内容包含危险的攻击请求 如何解决: 检查提交内容; 如网站托管,请联系空间提供商; 普通网站访客,请联系网站管理员;