Compiler can't find Python.h

ぐ巨炮叔叔 提交于 2019-12-29 01:05:15

问题


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>

I get this:

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

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!


回答1:


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

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




回答2:


Try:

sudo apt-get install python2.6-dev

if your Python version is python2.6



来源:https://stackoverflow.com/questions/7125522/compiler-cant-find-python-h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!