2006年12月27日 星期三 13:47
spring lee,您好!
Spring 说的对,正是因为c++编译后的函数名和C编译的不一样(C++带参数表);所以引用c写的库时用extern "C".
我也是由此猜测ctypes不能解析c++编译的库.
有大侠能指教应该怎样做吗?谢谢
======= 2006-12-27 13:19:49 您在来信中写道:=======
>> 猜测是因为libBase.so是C++写的,函数头格式和C的编译出来不一样.不知道是不是这样?
>你可以用nm libBase.so | grep xxxx 来查看一下是否有你需要的的导出函数的签名
>不知道是不是有可以直接调用C++函数的方法.因为这个可能每个编译器生成的C++导出函数名称都不一样吧。所以才推荐使用extern "C" 方式导入函数。
>_______________________________________________
>python-chinese
>Post: send python-chinese在lists.python.cn
>Subscribe: send subscribe to python-chinese-request在lists.python.cn
>Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
>Detail Info: http://python.cn/mailman/listinfo/python-chinese
= = = = = = = = = = = = = = = = = = = =
致
礼!
kevin
kevin_woso在126.com
2006-12-27
Zeuux © 2025
京ICP备05028076号