C++ Boost在当前目录中看不到文件
我正在尝试构建boost库,作为我想尝试的开源项目的一部分C++ Boost在当前目录中看不到文件,c++,boost,boost-build,C++,Boost,Boost Build,我正在尝试构建boost库,作为我想尝试的开源项目的一部分 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.j
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
工具集是MinGW/gcc,它正确地位于我的%PATH%上
所以基本上,boost没有看到当前目录中的boost build.jam
文件
请注意,我已正确设置了BOOST\u ROOT
:
C:\boost_1_55_0>echo %BOOST_ROOT%
c:/boost_1_55_0
我在这里有点不知所措。我尝试过前后斜杠的不同排列。另外,来自b2
的错误消息包括路径C:/share/boost build
,我不知道它来自哪里。我已经对整个代码库进行了完整搜索,但没有看到可能在任何地方指定它的配置文件
所以我可能需要提升。构建 无论如何,按照build Boost.build的说明生成的问题完全相同:
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'.
它不是在找你的档案。它正在寻找boost.buildtools子目录,其中包含支持jam脚本的子目录。在linux上,默认情况下这将是一个“/usr/share/boost build/”,在windows上,您可能需要将
boost\u build\u路径设置为指向安装boost.build支持脚本的位置:
好吧,我只能假设我的电脑的%PATH%
中有什么东西不知怎么坏了
我在一个干净的虚拟机中执行了相同的设置过程,它似乎编译得很好
我不知道具体出了什么问题。这看起来像是一个很老的问题,但如果它对任何人都有帮助,我也有同样的问题,这是因为我在/boost目录中,但需要在/boost/boost中。当我将目录更改为子目录并运行./bootstrap,然后运行./b2头时,它运行得很好
我在/boost目录中时,/bootstrap已经工作了,这有点让人困惑。boost的二进制构建根本不起作用,尝试构建是徒劳的
5.1简化的源代码构建
<>如果你想用VisualC++来从源代码构建,你可以使用简单的
本节中描述的构建过程。打开命令提示符并单击“下一步”
将当前目录更改为Boost根目录。然后,输入
以下命令:
引导。\b2
由于原始问题中的错误,这不起作用
5.2.1安装Boost.Build
Build是一个用于开发、测试和测试的基于文本的系统
安装软件。首先,您需要构建并安装它。做
这:
由于以下错误,这也不起作用:
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。Nope。我设置了BOOST\u BUILD\u路径
,但没有任何帮助。另外,带有相关jam脚本的boost-build.jam文件位于根文件夹中(my shell的pwd
)。最后,从阅读boost文档中我可以看出,boost\u BUILD\u PATH
基本上是可选的。最令人困惑的是,从我可以看出,我正在使用的相同过程对其他人来说没有问题。基本上,AFICT,你解压缩boost库,运行bootstrap.bat
,有时设置boost\u ROOT
,这是可选的,因为有一个内置的默认值(在您的例子中,默认值似乎是“c:/share/boostbuild”)。你也不能把boost构建的jam文件层次结构和你的(boost)项目层次结构混为一谈(如果我的记忆正确,最好先在某个地方完全安装boost.build,而不是构建boost的其余部分)。我是从boost.build的角度回答这个问题的(我是这个问题的常客)。我不知道windows上的boost源代码包应该做什么(我自己从未尝试过)。
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/'.