6

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.

1
  • THANK YOU! I could not figure out what the error was telling me. FYI if you are using vscode add to the include path ${workspaceFolder}/** /usr/include/python3.6m <your_path_to_boost>/boost_1_80/boost_1_80_0 and the error goes away. Also holy cow I have no idea why boost is so weird getting these libs built.... Commented Aug 25, 2022 at 2:33

1 Answer 1

3

you need to make sure the python/include folder is added to your includes. C:\Python\Python37\include for me on windows. You will also need to link the python library.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.