2

I'm trying to build the boost libraries as part of an open-source project I want to try to work on.

C:\boost_1_55_0>bootstrap.bat gcc
Building Boost.Build engine

Bootstrapping is done. To build, run:

    .\b2

[snip]

C:\boost_1_55_0>b2.exe --toolset=gcc
Unable to load Boost.Build: could not find "boost-build.jam"
---------------------------------------------------------------
BOOST_ROOT must be set, either in the environment, or
on the command-line with -sBOOST_ROOT=..., to the root
of the boost installation.

Attempted search from C:\boost_1_55_0 up to the root
at C:/share/boost-build
and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: c:/boost_1_55_0.
Please consult the documentation at 'http://www.boost.org'.

C:\boost_1_55_0>dir *.jam
 [snip]

 Directory of C:\boost_1_55_0

09/21/2013  01:17 PM               866 boost-build.jam
09/21/2013  01:17 PM            18,083 boostcpp.jam
12/16/2013  03:36 PM                76 project-config.jam
               3 File(s)         19,025 bytes
               0 Dir(s)  34,868,432,896 bytes free

Toolset is MinGW/gcc, which is properly on my %PATH%.

So basically, somehow, boost isn't seeing the boost-build.jam file that's in the current directory.

Note that I have properly set BOOST_ROOT:

C:\boost_1_55_0>echo %BOOST_ROOT%
c:/boost_1_55_0

I'm kinda at my wit's end here. I've tried different permutations of back and forward slashes. Also, the error message from b2 includes the path C:/share/boost-build, which I have no idea where it's coming from. I've done a full search on the entire codebase, and can't see a config file which may be specifying it anywhere.


So I may need Boost.Build?

Anyways, following the instructions from here to build Boost.Build produces the exact same issue:

C:\boost_1_55_0\tools\build\v2>echo %BOOST_ROOT%
C:/boost_1_55_0

C:\boost_1_55_0\tools\build\v2>bootstrap.bat gcc
Bootstrapping the build engine

Bootstrapping is done. To build, run:

    .\b2 --prefix=DIR install


C:\boost_1_55_0\tools\build\v2>b2 --toolset=gcc --prefix=c:/pathutils install
Unable to load Boost.Build: could not find "boost-build.jam"
---------------------------------------------------------------
BOOST_ROOT must be set, either in the environment, or
on the command-line with -sBOOST_ROOT=..., to the root
of the boost installation.

Attempted search from C:\boost_1_55_0\tools\build\v2 up to the root
at C:/boost_1_55_0/tools/build/share/boost-build
and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: C:\boost_1_55_0\tools\build\v2\test\startup\boost-root\build, C:/boost_1_55_0.
Please consult the documentation at 'http://www.boost.org'.
4

4 回答 4

1

好吧,我只能假设我的计算机中的某些东西正在以某种方式%PATH%破坏提升。

我在干净的 VM 中执行了相同的设置过程,它似乎编译得很好。

我不知道具体出了什么问题。

于 2013-12-21T09:57:02.893 回答
1

它不是在寻找您的 Jamfile。它正在寻找 boost.build tools 子目录,它包含支持的 jam 脚本。在 linux 上,默认情况下这将是“/usr/share/boost-build/”,在 Windows 上,您可能需要设置BOOST_BUILD_PATH指向 boost.build 支持脚本的安装位置:

http://www.boost.org/doc/libs/1_55_0/doc/html/bbv2/reference.html

于 2013-12-17T00:49:54.240 回答
0

这看起来是一个很老的问题,但如果它对任何人有帮助,我遇到了同样的问题,这是因为我在 /boost 目录中但需要在 /boost/boost 中。当我将目录更改为子目录并运行 ./bootstrap 后跟 ./b2 标头时,它工作正常。

当我在 /boost 目录中时, ./bootstrap 起作用了,但你去了。

于 2020-06-05T16:40:40.237 回答
0

boost 的二进制构建根本不起作用,尝试构建是徒劳的。

5.1 从源代码简化构建

如果您希望使用 Visual C++ 从源代码构建,可以使用本节中描述的简单构建过程。打开命令提示符并将当前目录更改为 Boost 根目录。然后,键入以下命令:

引导程序 .\b2

由于原始问题中的错误,这不起作用。

5.2.1 安装 Boost.Build

Boost.Build 是一个基于文本的系统,用于开发、测试和安装软件。首先,您需要构建和安装它。去做这个:

Go to the directory tools\build\v2\.
Run bootstrap.bat
Run b2 install --prefix=PREFIX where PREFIX is the directory where you want Boost.Build to be installed
Add PREFIX\bin to your PATH environment variable.

由于以下错误,这也不起作用:

Unable to load B2: could not find 'boost-build.jam'
---------------------------------------------------
Attempted search from 'C:sources\boost_1_75_0\tools\build' up to the root at 'C:sources\boost_1_75_0\tools\build\b2.EXE'
Please consult the documentation at 'https://boostorg.github.io/build/'.

上面错误中的地址没有说明如何使用 B2。

设计必须是天才,但在发现使用与 b2.exe 相同目录中的现有文件应该被视为安全默认值之前,我们,低级开发人员,是 SOL。

于 2021-01-03T22:52:35.303 回答