gpt4 book ai didi

python - 将 .c 文件编译为 .pyd

转载 作者:太空宇宙 更新时间:2023-11-04 07:27:14 24 4
gpt4 key购买 nike

我使用 Cython 将 .pyx 文件转换为 .c。现在,我尝试使用 tcc 编译器将其编译为 .pyd:

C:\Users\USER>"C:\Program Files\tcc\tcc.exe" tkExtra.c -o tkExtra.pyd -
shared -IC\Python27\include -LC\Python27\libs -lpython27

但是,我得到这个错误:

tkExtra.c:8: error: include file 'pyconfig.h' not found

C:\Python27\include 确实有 pyconfig.h。我看过this answer要获取命令行代码,只需将 gcc 替换为 tcc

我该如何解决这个问题,或者有更好的方法吗?

最佳答案

您似乎漏掉了一些冒号。尝试:

C:\Users\USER>"C:\Program Files\tcc\tcc.exe" tkExtra.c -o tkExtra.pyd -shared -IC:\Python27\include -LC:\Python27\libs -lpython27

关于python - 将 .c 文件编译为 .pyd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17255828/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com