在C++Builder应用程序中嵌入Python

2024-06-16 15:50:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我的项目是在C++Builder应用程序中嵌入Python。我使用的是python3.6。你知道吗

我在System Include path中添加了Python的Include文件夹,在Library path中添加了Python的Libs文件夹:

Tools > Environment options > C++ Options > Paths and Directories

这里是MyUnit1.cpp

#include <vcl.h>
#include <Python.h>
#pragma hdrstop

#include "Unit1.h"
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;

__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
  {
  }

但我有个错误:

[bcc32 Error] Unit1.cpp(4): E2209 Unable to open include file 'Python.h'


Tags: path项目文件夹应用程序includebuilderlibrarysystem