添加 boost 安装的路径目录

添加 boost 安装的路径目录

我已经在笔记本电脑的主目录中安装了 boost_1.58_0。经过一些处理后,我看到了以下消息:

The following directory should be added to compiler include paths:

/home/acerv3-571g/boost_1_58_0

The following directory should be added to linker library paths:

/home/acerv3-571g/boost_1_58_0/stage/lib

然而,对于其他版本的 boost,我看过一些帖子,但不幸的是我无法使用它们。鉴于我对 ubuntu 的了解不多,我认为它们不是那么直接和清晰。

以下几行与评论相关

 # ~/.bashrc: executed by bash(1) for non-login shells.
 # see /usr/share/doc/bash/examples/startup-files (in the package    bash-doc)
# for examples

 # If not running interactively, don't do anything
 case $- in
 *i*) ;;
  *) return;;
esac

    # don't put duplicate lines or lines starting with space in the     history.
   # See bash(1) for more options
   HISTCONTROL=ignoreboth

 # append to the history file, don't overwrite it
  shopt -s histappend

  # for setting history length see HISTSIZE and HISTFILESIZE in    bash(1)
    HISTSIZE=1000
    HISTFILESIZE=2000

     # check the window size after each command and, if necessary,
      # update the values of LINES and COLUMNS.
    shopt -s checkwinsize

    # If set, the pattern "**" used in a pathname expansion context will
   # match all files and zero or more directories and subdirectories.
   #shopt -s globstar

答案1

您需要以下命令:

export INCLUDE="/home/acerv3-571g/boost_1_58_0:$INCLUDE"
export LIBRARY_PATH="/home/acerv3-571g/boost_1_58_0/stage/lib:$LIBRARY_PATH"

您可以在终端中执行它们,以在当前终端会话中设置这些变量。如果要使它们永久存在,您必须将这些行添加到您的.bashrc

相关内容