This article mainly aims at modifying bugs and installing Python in c ++. in the jam file, we need to introduce relevant issues and how to deal with these problems, the following are the answers to relevant questions and descriptions of the compilation process when embedding python in c ++.
The compilation process will not be repeated. Here is a small bug in boost. I don't know if the following error occurs during compilation of Hello World.
- Jamroot:18: in modules.load
- rule python-extension unknown in module Jamfile</F:/
boost_1_38_0/libs/py
- mple/tutorial>.
- F:/boost_1_38_0/tools/build/v2/build\project.jam:313:
in load-jamfile
- F:/boost_1_38_0/tools/build/v2/build\project.jam:62:
in load
- F:/boost_1_38_0/tools/build/v2/build\project.jam:168:
in project.find
- F:/boost_1_38_0/tools/build/v2\build-system.jam:535:
in load
- F:\boost_1_38_0\tools\build\v2/kernel\modules.jam:283:
in import
- F:\boost_1_38_0\tools\build\v2/kernel/bootstrap.jam:138:
in boost-build
- F:\boost_1_38_0\libs\python\example\boost-build.jam:7:
in module scope
The above code is to embed python in c ++-Bug modification and. the introduction of the jam file should be noted. It took me a long time to find it in mail lists of python. In mail lists of python. The solution is as follows:
Find the user-config.jam file in the boost \ boost_000038_0 \ tools \ build \ v2 \ directory, open
- import toolset : using ;
Add a line of code below:
- using python ;
Or directly add
- using python ;
Re-compile the boost, and then there will be no problem. The hello in tutorial can be compiled successfully. Ps. This problem has plagued me for a long time. Sigh. In the jam file, change '\' in the path under Windows to '/' or '/'. In addition, each path must have spaces before and after, and, note This when modifying jam. The above is an introduction to how to embed Python in c ++ -- about Bug modification and related content in the. jam file. I hope you will gain some benefits.