如果这是一个愚蠢的问题,我深表歉意。但是我试着用谷歌搜索这个,但我找不到任何东西来指引我正确的方向。我只是想了解我需要做什么来“设置”cdt 以“理解”我的 python.h 包含。
错误的说法是这样的:
#include <Python.h>
但我也试过了
#include "Python.h"
CDT 会在旁边用一个错误标志做出回应:
Multiple markers at this line
- fatal error: Python.h: No such file or
directory
- Unresolved inclusion: <Python.h>
我在 Ubuntu 12.04 上使用 Eclipse CDT Juno。任何指针都会很棒!
最佳答案
请参阅此路径以了解如何设置环境以使用 cpython。
- fully detailed tutorial for Linux
- 小github项目包含在 MAC OSx 上使用的所有相关文件。
- 使用 python-config 获取
Python.h
和 python 静态库的路径,您应该将代码与之链接。
关于c++ - 在 C++ 文件 CDT 中包含 Python.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15670586/