当前环境是Win7 + Python3.4 + GCC4.9.3
不需要按网上流传的方法重新安装一个巨大的Visual Studio,或者修改Python的安装脚本,直接用下面两条命令即可:
gcc.exe -mdll -O -Wall -Id:\Python\include -Id:\Python\include -c main.c -o demo.o
gcc -shared -s main.c -o demo.so -Id:\Python\include -Ld:\Python\libs -Ld:\Python\PCbuild -lpython34 -lmsvcr100 -o demo.dll
本文介绍在Windows 7环境下使用Python 3.4和GCC 4.9.3进行DLL编译的方法,避免了安装庞大的Visual Studio或修改Python安装脚本的繁琐步骤,仅需两条gcc命令即可完成。
2万+

被折叠的 条评论
为什么被折叠?



