C++ embedding Python

C++ embedding Python

本文关键字:Python embedding C++      更新时间:2023-10-16

我想用C++运行Python-Scripts。

在我的书中,有以下内容:

#include <Python.h>
... at main function some calls

但是在编译编译器找不到Python头文件时。

我该如何解决这个问题?

在Linux Mint上,sudo apt-get install python-dev应该可以完成这项工作。 这将获取并安装 python 开发文件。

这应该将包含文件放在/usr/include/python2.7/,因此您需要将-l /usr/include/python2.7/添加到编译器标志中。

'