编译器找不到Python.h [英] Compiler can't find Python.h

查看:344
本文介绍了编译器找不到Python.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C的新人,我似乎不能做我想要的。我需要为C函数做一些Python绑定,我想我可以想出这一点。但是有一条线不能工作。

I'm kinda new to C, and I can't seem to do what I want. I need to make some Python bindings for C functions, and I think I can figure this out. But there's one little line that WILL NOT WORK.

#include <Python.h>

我得到:

fatal error #1035: Can't find include file <Python.h>.

我试过了一切。我刚刚把Python.h在我的项目第一个在同一个文件夹。然后我把文件名放在链接器下的Library和Object文件中。然后我做了同样的python31.lib,然后我把目录python31.lib在我的PATH变量。没有什么会让我越过这条线。我在网上看到很多针对Linux的解决方案,但是没有针对Windows的解决方案。请帮助!

I've tried everything. I just stuck Python.h in the same folder as my project first. Then I put the file name in Library and Object files under linker. Then I did the same with python31.lib, then I put the directory python31.lib is in in my PATH variable. Nothing will let me get past this line. I see a lot of solutions on the net for Linux, but none for Windows. Please help!

推荐答案

糟糕,在评论中回答。

Whoops, answered in a comment. Here's a more answerly answer.

请确保您在包含路径中包含 Python.h 库路径。

Make sure you put Python.h in your include path and the library in your library path.

这篇关于编译器找不到Python.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆