无法将 boost 安装到其他目录

Can't install boost to another directories

本文关键字:其他 安装 boost      更新时间:2023-10-16

我只想使用Boost库的文件系统。我想要指定目录中的头文件和二进制文件。

所以我做了什么:

下载boost(文件类型:tar.gz(并提取到~/boost_1_05_0

按如下方式运行bootstrap.sh:./bootstrap.sh --with-libraries=filesystem --libdir=~/boost155/lib --includedir=~/boost155/header/

bootstrap生成的project-config.jam的详细信息:

# Boost.Build Configuration
# Automatically generated by bootstrap.sh
import option ;
import feature ;
# Compiler configuration. This definition will be used unless
# you already have defined some toolsets in your user-config.jam
# file.
if ! gcc in [ feature.values <toolset> ]
{
    using gcc ; 
}
project : default-build <toolset>gcc ;
# List of --with-<library> and --without-<library>
# options. If left empty, all libraries will be built.
# Options specified on the command line completely
# override this variable.
libraries =  --with-filesystem ;
# These settings are equivivalent to corresponding command-line
# options.
option.set prefix : /usr/local ;
option.set exec-prefix : /usr/local ;
option.set libdir : ~/boost155/lib ;
option.set includedir : ~/boost155/header/ ;
# Stop on first error
option.set keep-going : false ;

然后我跑了/b2

命令结果:

link.jam: No such file or directory
Building the Boost C++ Libraries.

Component configuration:
    - atomic                   : not building
    - chrono                   : not building
    - context                  : not building
    - coroutine                : not building
    - date_time                : not building
    - exception                : not building
    - filesystem               : building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : not building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - wave                     : not building
...patience...
...found 496 targets...

The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
    /home/esys/boost_1_55_0
The following directory should be added to linker library paths:
    /home/esys/boost_1_55_0/stage/lib

正如您所看到的,b2没有在我想要的目录中安装库和头。我还检查了文件夹,它是空白的。

我想问题是缺少一个链接。但是在网上搜索什么都没有。

任何想法都将不胜感激:(

您必须运行

./b2 install

而不是简单的

./b2

(通过文档(