python - Boost Python "cannot open source file 'pyconfig.h'" when importing using "#include "
问题描述
I am attempting to use Boost Python for a project. I have downloaded and build version 1.70 on Windows 10, and I am using Visual Studio Code. When attempting to import boost into my c++ project with the line:
#include <boost\python.hpp>
, I receive the following error:
cannot open source file "pyconfig.h" (dependency of "boost\python.hpp")
I have looked into similar issues, and the primary solution I have found was to edit user-config.jam to include the location of my python installation. I have done so, and the line within user-config.jam looks like this:
using python : 3.7 : C:\Users\broke\AppData\Local\Programs\Python\Python37 ;
After adding this line, I rebuilt Boost Python. This did nothing to remedy the issue. I would greatly appreciate help on this matter. Thank you.
解决方案
您需要确保将python/include
文件夹添加到您的包含中。C:\Python\Python37\include
对我来说在窗户上。您还需要链接 python 库。
推荐阅读
- sql - Postgresql:实现对聚合 SUM 的检查约束
- uinavigationbar - 让 SwiftUI 导航栏透明
- angular - 如何在保存打印到控制台时打印选定的项目
- angular - 无法访问 ngx bootstrap 中的模态组件内容
- python - 不能使用多进程线程和队列进行 q.get()
- android - Android Studio 3.5 中缺少即时运行
- html - 使用溢出-x:滚动内容将模糊效果固定到 div 的右边缘
- java - 在没有特定属性的情况下访问对象中的模型值
- spring-boot - 在 Spring Boot 中,如何在每次测试之前重置指标注册表?
- r - 在多个数据框中查找匹配值