我已经在 Linux Debian 中安装了 boost 1.54(根据this)。然后我安装了
bjam
,如下:
apt-get install bjam
然后,为了使用 boost filesystem
运行示例
tut1程序,我输入:
$ cd boost-root/libs/filesystem/example/test
$ ./setup.sh
$ ./bld.sh
这应该会生成
tut1
文件。但tut1
文件夹中没有test
文件。这里只有tut1.cpp
被setup.sh
复制。我怀疑安装的bjam
不是针对boost 1.54的。如何正确安装bjam?
输入
bjam
后我得到:
warning: mismatched versions of Boost.Build engine and core
warning: Boost.Build engine (bjam) is 03.1.16
warning: Boost.Build core (at /usr/include/boost_1_54_0/tools/build/v2) is 2011.12-svn
2023年9月22日仍然遇到问题
在linux debian中,我是这样解决问题的:
sudo ./bootstrap.sh --prefix=/usr/local
sudo ./b2 install
/usr/bin/b2 --version
error: mismatched versions of B2 engine and core
error: B2 engine (/usr/bin/b2) is 4.3.0
error: B2 core (at /home/boost_1_83_0/tools/build/src) is 4.10-git
/usr/local/bin/b2 --version
B2 4.10-git
sudo cp /usr/local/bin/b2 /usr/bin/b2
b2 --version
B2 4.10-git