Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/129.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python,C++&;升华文本2:Python.h:没有这样的文件或目录 希望用一些Python扩展我的C++。_Python_C++_Sublimetext2 - Fatal编程技术网

Python,C++&;升华文本2:Python.h:没有这样的文件或目录 希望用一些Python扩展我的C++。

Python,C++&;升华文本2:Python.h:没有这样的文件或目录 希望用一些Python扩展我的C++。,python,c++,sublimetext2,Python,C++,Sublimetext2,文件im大楼: #include <Python.h> ^python开发是最新的 找到了一些谷歌链接,其中包括构建路径之类的内容,但这不是我的强项 -I/usr/include/python2.7/ 尝试将此添加到包下的C++ .崇高文本文件中的构建命令中,但只是中断了生成系统。帮助,我是一个无能的小人物 < >在崇高的文本/包/ C++(你可以通过偏爱找到->浏览包-> C++)编辑文件称为C++ +崇高构建。在“cmd”行中: UBUNTU "cmd": ["g++", "

文件im大楼:

#include <Python.h>
^python开发是最新的

找到了一些谷歌链接,其中包括构建路径之类的内容,但这不是我的强项

-I/usr/include/python2.7/

尝试将此添加到包下的C++ .崇高文本文件中的构建命令中,但只是中断了生成系统。帮助,我是一个无能的小人物

< >在崇高的文本/包/ C++(你可以通过偏爱找到->浏览包-> C++)编辑文件称为C++ +崇高构建。在“cmd”行中:

UBUNTU

"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"]
添加'-I/usr/include/python2.7-lpython2.7',如下所示:(/usr/include/python2.7是Python.h目录)

窗口

"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"]
添加'-I/Python27/include',如下所示:(/Python27/include是Python.h目录)

保存并准备好“增压”代码;)


注意:我对构建代码之类的东西很糟糕,因此这可能不是解决问题的最优雅的方式

+1因为你称自己是一个无知的小人这个命令在你的系统上的输出是什么:
sudo updated b&&locate Python.h
~/Downloads/Python-2.7.5/Include/Python.h
/usr/include/python2.7/Python.h
/usr/local/include/python2.7/Python.h
谢谢您的时间,您看过类似的问题吗?
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"]
"cmd": ["g++", "-I/usr/include/python2.7", "${file}", "-lpython2.7", "-o", "${file_path}/${file_base_name}"]
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"]
"cmd": ["g++", "${file}", "-I/Python27/include", "-L/Python27/libs", "-lpython27", "-o", "${file_path}/${file_base_name}"]