简体   繁体   English

在Linux下使用distutils交叉编译python扩展

[英]Cross-compiling python extensions under Linux using distutils

Is there any way to compile both Windows and Linux versions of Python/distutils/SWIG/C++ extensions under Linux? 有什么方法可以在Linux下编译Windows和Linux版本的Python / distutils / SWIG / C ++扩展? As far as I understand the problem is at least in obtaining windows version of python-dev. 据我了解,问题至少在于获取Windows版本的python-dev。

Thank you. 谢谢。

You could do it in two ways: 您可以通过两种方式做到这一点:

  1. Install MingW on your linux system, and cross-compile the extension using it 在Linux系统上安装MingW ,并使用它交叉编译扩展

  2. Compile it in a Windows Virtual Machine (eg. Windows7 on VirtualBox ) 在Windows虚拟机(例如VirtualBox上的 Windows7)中编译它

I prefer the second option as it gives the opportunity to test that your program is working 我喜欢第二个选项,因为它使您有机会测试您的程序是否正常运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM