【发布时间】:2018-05-06 09:00:26
【问题描述】:
我正在尝试将这一行包含在我的 .c 代码中
#include <Python.h>
我的 helloworld.c 中只有
#include <stdio.h>
#include <Python.h>
int main()
{
printf("Hi, this is me. \n");
system("pause");
return 0;
}
我还没有写任何使用 python.h 的东西,因为我无法 编译。这是我得到的错误:
fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
我正在使用 CL.exe,Visual Studio 2017 的命令行编译器来运行它:
cl /LD helloworld.c
如何让编译器知道我的 python.h 在哪里?
【问题讨论】:
-
/LD?你确定吗? -
您要使用选项
/?并阅读吗? -
是的,我正在尝试编写一个 .DLL 供我的 python 调用。
-
对不起,我应该这么说的。
-
这可能也有帮助:msdn.microsoft.com/en-us/library/fwkeyyhe.aspx - 你仍然需要阅读它;-)
标签: python c visual-studio include-path