Search code examples
c++boost

boost version 1.74.0 - command "b2" fails with: ERROR: rule "require-b2" unknown in module "Jamfile<C:\projects\boost-1.74.0\libs\charconv>"


boost version 1.74.0 - command "b2" fails with: ERROR: rule "require-b2" unknown in module "Jamfile<C:\projects\boost-1.74.0\libs\charconv>".

I need to compile some old code that requires boost version 1.74.0. When I try to build boost version 1.74.0, the command "b2" fails with this error:

ERROR: rule "require-b2" unknown in module "Jamfile<C:\projects\boost-1.74.0\libs\charconv>".

What am I doing wrong? Here are the steps that I followed:

> git clone --recurse-submodules https://github.com/boostorg/boost.git boost-1.74.0
> cd boost-1.74.0
> git checkout boost-1.74.0
> git submodule update --init --recursive
> .\bootstrap.bat
> .\b2
libs\charconv\build.jam:6: in modules.load
ERROR: rule "require-b2" unknown in module "Jamfile<C:\projects\boost-1.74.0\libs\charconv>".
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:372: in load-jamfile
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:64: in load
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:109: in load-parent
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:513: in initialize
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:348: in load-jamfile
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:64: in load
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:89: in load-used-projects
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:75: in load
C:/projects/boost-1.74.0/tools/build/src/build\project.jam:142: in project.find
C:/projects/boost-1.74.0/tools/build/src\build-system.jam:618: in load
C:/projects/boost-1.74.0/tools/build/src/kernel\modules.jam:295: in import
C:/projects/boost-1.74.0/tools/build/src/kernel/bootstrap.jam:139: in boost-build
C:/projects/boost-1.74.0/boost-build.jam:17: in module scope

Solution

  • Since you're using an older release of Boost, certain libs might be in your source directory that are not compatible with the 1.74.

    In your case, this seems to be libs\charconv. If you run git status, it should show that path (amongst others) as an untracked file. If so, feel free to delete that path and you should be able to compile after that.

    If you get more issues similar to the current one, delete those paths as well. Hope this helps.