[英]Where should I put the C source files in a Python program?
I am trying to compile a Python program which includes some C files. 我正在尝试编译包含一些C文件的Python程序。
In one file emodule.c
it reads: 在一个文件
emodule.c
其内容为:
#include "Python.h"
#include "ul/ul.h"
I already have the ul
folder and put it in the same folder with emodule.c
, however, when I run python setup.py build
, it stills says: 我已经有了
ul
文件夹,并将其与emodule.c
放在同一文件夹中,但是,当我运行python setup.py build
,它仍然显示:
fatal error: ul/ul.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Where should I put the ul
folder? ul
文件夹应该放在哪里?
Try adding include_dirs = ['ul']
to the call to setup()
in setup.py
. 尝试在
setup.py
中将include_dirs = ['ul']
到对setup()
的调用中。
See the Preprocessor Options section of the setupscripts
documentation for more information. 有关更多信息,请参见
setupscripts
文档的Preprocessor Options部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.