当前位置:  开发笔记 > 编程语言 > 正文

如何在gnu/linux上安装boost

如何解决《如何在gnu/linux上安装boost》经验,为你挑选了1个好方法。

有这么多的教程,但没有说明我如何正确安装这个库.我想将它安装在默认的gnu/linux库目录中.

我试过了:

$ sudo ./bootstrap.sh
$ ./b2 install

现在它安装在哪里?它安装了吗?

运行后./b2 install我得到以下输出:

z@z-comptuer:~/Desktop/.mess/boost_1_55_0/tools/build/v2$ sudo ./b2 install
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 580 targets...
...updating 306 targets...
common.mkdir /usr/local/share/boost-build
common.mkdir /usr/local/share/boost-build/tools
common.copy /usr/local/share/boost-build/tools/msvc.jam
common.copy /usr/local/share/boost-build/tools/cast.py
common.copy /usr/local/share/boost-build/tools/qt4.jam
common.copy /usr/local/share/boost-build/tools/make.jam
common.copy /usr/local/share/boost-build/tools/common.jam
common.copy /usr/local/share/boost-build/tools/intel.jam
common.copy /usr/local/share/boost-build/tools/gcc.py
common.copy /usr/local/share/boost-build/tools/borland.jam
common.copy /usr/local/share/boost-build/tools/cw.jam
common.copy /usr/local/share/boost-build/tools/python-config.jam
common.copy /usr/local/share/boost-build/tools/mc.jam
common.copy /usr/local/share/boost-build/tools/docutils.jam
common.copy /usr/local/share/boost-build/tools/doxygen.jam
common.copy /usr/local/share/boost-build/tools/testing-aux.jam
common.copy /usr/local/share/boost-build/tools/cast.jam
common.copy /usr/local/share/boost-build/tools/gcc.jam
common.copy /usr/local/share/boost-build/tools/message.jam
common.mkdir /usr/local/share/boost-build/tools/types
common.copy /usr/local/share/boost-build/tools/types/lib.jam
common.copy /usr/local/share/boost-build/tools/types/__init__.py
common.copy /usr/local/share/boost-build/tools/types/lib.py
common.copy /usr/local/share/boost-build/tools/types/asm.py
common.copy /usr/local/share/boost-build/tools/types/objc.jam
common.copy /usr/local/share/boost-build/tools/types/preprocessed.py
common.copy /usr/local/share/boost-build/tools/types/preprocessed.jam
common.copy /usr/local/share/boost-build/tools/types/html.jam
common.copy /usr/local/share/boost-build/tools/types/obj.py
common.copy /usr/local/share/boost-build/tools/types/html.py
common.copy /usr/local/share/boost-build/tools/types/register.jam
common.copy /usr/local/share/boost-build/tools/types/obj.jam
common.copy /usr/local/share/boost-build/tools/types/rsp.jam
common.copy /usr/local/share/boost-build/tools/types/cpp.jam
common.copy /usr/local/share/boost-build/tools/types/asm.jam
common.copy /usr/local/share/boost-build/tools/types/exe.jam
common.copy /usr/local/share/boost-build/tools/types/cpp.py
common.copy /usr/local/share/boost-build/tools/types/qt.jam
common.copy /usr/local/share/boost-build/tools/types/rsp.py
common.copy /usr/local/share/boost-build/tools/types/exe.py
common.mkdir /usr/local/share/boost-build/tools/doxygen
common.copy /usr/local/share/boost-build/tools/doxygen/windows-paths-check.hpp
common.copy /usr/local/share/boost-build/tools/doxygen/windows-paths-check.doxyfile
common.mkdir /usr/local/share/boost-build/tools/xsltproc
common.copy /usr/local/share/boost-build/tools/xsltproc/included.xsl
common.copy /usr/local/share/boost-build/tools/xsltproc/test.xml
common.copy /usr/local/share/boost-build/tools/xsltproc/test.xsl
common.mkdir /usr/local/share/boost-build/example
common.copy /usr/local/share/boost-build/example/boost-build.jam
common.mkdir /usr/local/share/boost-build/example/customization
common.copy /usr/local/share/boost-build/example/customization/jamroot.jam
common.copy /usr/local/share/boost-build/example/customization/verbatim.jam
common.copy /usr/local/share/boost-build/example/customization/class.verbatim
common.copy /usr/local/share/boost-build/example/customization/t2.verbatim
common.copy /usr/local/share/boost-build/example/customization/readme.txt
common.copy /usr/local/share/boost-build/example/customization/t1.verbatim
common.copy /usr/local/share/boost-build/example/customization/usage.verbatim
common.copy /usr/local/share/boost-build/example/customization/codegen.cpp
common.copy /usr/local/share/boost-build/example/customization/verbatim.py
common.copy /usr/local/share/boost-build/example/customization/inline_file.py
common.mkdir /usr/local/share/boost-build/example/make
common.copy /usr/local/share/boost-build/example/make/jamroot.jam
common.copy /usr/local/share/boost-build/example/make/readme.txt
common.copy /usr/local/share/boost-build/example/make/foo.py
common.copy /usr/local/share/boost-build/example/make/main_cpp.pro
common.mkdir /usr/local/share/boost-build/example/qt
common.copy /usr/local/share/boost-build/example/qt/README.txt
common.mkdir /usr/local/share/boost-build/example/libraries
common.copy /usr/local/share/boost-build/example/libraries/jamroot.jam
common.mkdir /usr/local/share/boost-build/example/python_modules
common.copy /usr/local/share/boost-build/example/python_modules/python_helpers.py
common.copy /usr/local/share/boost-build/example/python_modules/jamroot.jam
common.copy /usr/local/share/boost-build/example/python_modules/readme.txt
common.copy /usr/local/share/boost-build/example/python_modules/python_helpers.jam
common.mkdir /usr/local/share/boost-build/example/variant
common.copy /usr/local/share/boost-build/example/variant/jamroot.jam
common.copy /usr/local/share/boost-build/example/variant/readme.txt
common.copy /usr/local/share/boost-build/example/variant/a.cpp
common.copy /usr/local/share/boost-build/example/variant/jamfile.jam
common.mkdir /usr/local/share/boost-build/example/generate
common.copy /usr/local/share/boost-build/example/generate/REAME.txt
common.copy /usr/local/share/boost-build/example/generate/jamroot.jam
common.copy /usr/local/share/boost-build/example/generate/gen.py
common.copy /usr/local/share/boost-build/example/generate/gen.jam
common.copy /usr/local/share/boost-build/example/generate/a.cpp
common.mkdir /usr/local/share/boost-build/example/generator
common.copy /usr/local/share/boost-build/example/generator/README.txt
common.copy /usr/local/share/boost-build/example/generator/jamroot.jam
common.copy /usr/local/share/boost-build/example/generator/foo.gci
common.copy /usr/local/share/boost-build/example/generator/soap.jam
common.mkdir /usr/local/share/boost-build/example/gettext
common.copy /usr/local/share/boost-build/example/gettext/jamroot.jam
common.copy /usr/local/share/boost-build/example/gettext/russian.po
common.copy /usr/local/share/boost-build/example/gettext/main.cpp
common.copy /usr/local/share/boost-build/example/gettext/readme.txt
common.copy /usr/local/share/boost-build/example/gettext/jamfile.jam
common.mkdir /usr/local/share/boost-build/example/hello
common.copy /usr/local/share/boost-build/example/hello/jamroot.jam
common.copy /usr/local/share/boost-build/example/hello/readme.txt
...on 100th target...
common.copy /usr/local/share/boost-build/example/hello/hello.cpp
common.mkdir /usr/local/share/boost-build/example/pch
common.copy /usr/local/share/boost-build/example/pch/jamroot.jam
common.mkdir /usr/local/share/boost-build/example/built_tool
common.copy /usr/local/share/boost-build/example/built_tool/Jamroot.jam
common.copy /usr/local/share/boost-build/example/built_tool/readme.txt
common.mkdir /usr/local/share/boost-build/example/libraries/app
common.copy /usr/local/share/boost-build/example/libraries/app/app.cpp
common.copy /usr/local/share/boost-build/example/libraries/app/jamfile.jam
common.mkdir /usr/local/share/boost-build/example/variant/libs
common.copy /usr/local/share/boost-build/example/variant/libs/l.cpp
common.copy /usr/local/share/boost-build/example/variant/libs/jamfile.jam
common.mkdir /usr/local/share/boost-build/example/pch/include
common.copy /usr/local/share/boost-build/example/pch/include/pch.hpp
common.mkdir /usr/local/share/boost-build/example/pch/source
common.copy /usr/local/share/boost-build/example/pch/source/hello_world.cpp
common.mkdir /usr/local/share/boost-build/example/built_tool/core
common.copy /usr/local/share/boost-build/example/built_tool/core/a.td
common.copy /usr/local/share/boost-build/example/built_tool/core/core.cpp
common.copy /usr/local/share/boost-build/example/built_tool/core/Jamfile.jam
common.mkdir /usr/local/share/boost-build/example/built_tool/tblgen
common.copy /usr/local/share/boost-build/example/built_tool/tblgen/tblgen.cpp
common.copy /usr/local/share/boost-build/example/built_tool/tblgen/Jamfile.jam
common.mkdir /usr/local/share/boost-build/example/qt/qt4
common.mkdir /usr/local/share/boost-build/example/qt/qt4/moccable-cpp
common.copy /usr/local/share/boost-build/example/qt/qt4/moccable-cpp/jamroot.jam
common.copy /usr/local/share/boost-build/example/qt/qt4/moccable-cpp/main.cpp
common.mkdir /usr/local/share/boost-build/example/qt/qt4/hello
common.copy /usr/local/share/boost-build/example/qt/qt4/hello/jamroot.jam
common.copy /usr/local/share/boost-build/example/qt/qt4/hello/arrow.cpp
common.copy /usr/local/share/boost-build/example/qt/qt4/hello/main.cpp
common.copy /usr/local/share/boost-build/example/qt/qt4/hello/arrow.h
common.mkdir /usr/local/share/boost-build/example/qt/qt4/uic
common.copy /usr/local/share/boost-build/example/qt/qt4/uic/hello_world_widget.ui
common.copy /usr/local/share/boost-build/example/qt/qt4/uic/jamroot.jam
common.copy /usr/local/share/boost-build/example/qt/qt4/uic/main.cpp
common.mkdir /usr/local/share/boost-build/example/qt/qt3
common.mkdir /usr/local/share/boost-build/example/qt/qt3/moccable-cpp
common.copy /usr/local/share/boost-build/example/qt/qt3/moccable-cpp/jamroot.jam
common.copy /usr/local/share/boost-build/example/qt/qt3/moccable-cpp/main.cpp
common.mkdir /usr/local/share/boost-build/example/qt/qt3/hello
common.copy /usr/local/share/boost-build/example/qt/qt3/hello/jamroot.jam
common.copy /usr/local/share/boost-build/example/qt/qt3/hello/main.cpp
common.copy /usr/local/share/boost-build/example/qt/qt3/hello/canvas.h
common.copy /usr/local/share/boost-build/example/qt/qt3/hello/canvas.cpp
common.mkdir /usr/local/share/boost-build/example/qt/qt3/uic
common.copy /usr/local/share/boost-build/example/qt/qt3/uic/hello_world_widget.ui
common.copy /usr/local/share/boost-build/example/qt/qt3/uic/jamroot.jam
common.copy /usr/local/share/boost-build/example/qt/qt3/uic/main.cpp
common.mkdir /usr/local/share/boost-build/example/libraries/util
common.mkdir /usr/local/share/boost-build/example/libraries/util/foo
common.copy /usr/local/share/boost-build/example/libraries/util/foo/bar.cpp
common.copy /usr/local/share/boost-build/example/libraries/util/foo/jamfile.jam
common.mkdir /usr/local/share/boost-build/example/libraries/util/foo/include
common.copy /usr/local/share/boost-build/example/libraries/util/foo/include/lib1.h
common.copy /usr/local/bin/b2
common.copy /usr/local/bin/bjam
common.copy /usr/local/share/boost-build/boost-build.jam
common.copy /usr/local/share/boost-build/build-system.jam
common.mkdir /usr/local/share/boost-build/build
common.copy /usr/local/share/boost-build/build/feature.py
common.copy /usr/local/share/boost-build/build/alias.py
common.copy /usr/local/share/boost-build/build/toolset.jam
common.copy /usr/local/share/boost-build/build/generators.jam
common.copy /usr/local/share/boost-build/build/ac.jam
common.copy /usr/local/share/boost-build/build/__init__.py
common.copy /usr/local/share/boost-build/build/feature.jam
common.copy /usr/local/share/boost-build/build/scanner.jam
common.copy /usr/local/share/boost-build/build/property_set.py
common.copy /usr/local/share/boost-build/build/configure.jam
common.copy /usr/local/share/boost-build/build/build-request.jam
common.copy /usr/local/share/boost-build/build/alias.jam
common.copy /usr/local/share/boost-build/build/generators.py
common.copy /usr/local/share/boost-build/build/project.py
common.copy /usr/local/share/boost-build/build/build_request.py
common.copy /usr/local/share/boost-build/build/targets.jam
common.copy /usr/local/share/boost-build/build/type.jam
common.copy /usr/local/share/boost-build/build/project.jam
common.copy /usr/local/share/boost-build/build/errors.py
common.copy /usr/local/share/boost-build/build/property.py
common.copy /usr/local/share/boost-build/build/type.py
common.copy /usr/local/share/boost-build/build/property-set.jam
common.copy /usr/local/share/boost-build/build/config-cache.jam
common.copy /usr/local/share/boost-build/build/scanner.py
common.copy /usr/local/share/boost-build/build/virtual-target.jam
common.copy /usr/local/share/boost-build/build/property.jam
common.copy /usr/local/share/boost-build/build/targets.py
common.copy /usr/local/share/boost-build/build/version.jam
common.copy /usr/local/share/boost-build/build/configure.py
common.copy /usr/local/share/boost-build/build/toolset.py
common.copy /usr/local/share/boost-build/build/virtual_target.py
common.copy /usr/local/share/boost-build/build/project.ann.py
common.copy /usr/local/share/boost-build/build/engine.py
common.mkdir /usr/local/share/boost-build/kernel
common.copy /usr/local/share/boost-build/kernel/errors.jam
common.copy /usr/local/share/boost-build/kernel/bootstrap.jam
common.copy /usr/local/share/boost-build/kernel/boost-build.jam
common.copy /usr/local/share/boost-build/kernel/class.jam
common.copy /usr/local/share/boost-build/kernel/modules.jam
common.copy /usr/local/share/boost-build/kernel/bootstrap.py
...on 200th target...
common.mkdir /usr/local/share/boost-build/util
common.copy /usr/local/share/boost-build/util/logger.py
common.copy /usr/local/share/boost-build/util/order.jam
common.copy /usr/local/share/boost-build/util/set.jam
common.copy /usr/local/share/boost-build/util/os.jam
common.copy /usr/local/share/boost-build/util/__init__.py
common.copy /usr/local/share/boost-build/util/path.py
common.copy /usr/local/share/boost-build/util/sequence.py
common.copy /usr/local/share/boost-build/util/print.jam
common.copy /usr/local/share/boost-build/util/option.py
common.copy /usr/local/share/boost-build/util/os_j.py
common.copy /usr/local/share/boost-build/util/utility.jam
common.copy /usr/local/share/boost-build/util/regex.py
common.copy /usr/local/share/boost-build/util/option.jam
common.copy /usr/local/share/boost-build/util/path.jam
common.copy /usr/local/share/boost-build/util/assert.jam
common.copy /usr/local/share/boost-build/util/numbers.jam
common.copy /usr/local/share/boost-build/util/container.jam
common.copy /usr/local/share/boost-build/util/regex.jam
common.copy /usr/local/share/boost-build/util/set.py
common.copy /usr/local/share/boost-build/util/doc.jam
common.copy /usr/local/share/boost-build/util/indirect.jam
common.copy /usr/local/share/boost-build/util/indirect.py
common.copy /usr/local/share/boost-build/util/utility.py
common.copy /usr/local/share/boost-build/util/string.jam
common.copy /usr/local/share/boost-build/util/sequence.jam
common.copy /usr/local/share/boost-build/util/order.py
common.copy /usr/local/share/boost-build/tools/png.jam
common.copy /usr/local/share/boost-build/tools/xsltproc-config.jam
common.copy /usr/local/share/boost-build/tools/pch.py
common.copy /usr/local/share/boost-build/tools/python.jam
common.copy /usr/local/share/boost-build/tools/msvc.py
common.copy /usr/local/share/boost-build/tools/mc.py
common.copy /usr/local/share/boost-build/tools/testing.jam
common.copy /usr/local/share/boost-build/tools/como.jam
common.copy /usr/local/share/boost-build/tools/intel-win.jam
common.copy /usr/local/share/boost-build/tools/__init__.py
common.copy /usr/local/share/boost-build/tools/clang-darwin.jam
common.copy /usr/local/share/boost-build/tools/stage.py
common.copy /usr/local/share/boost-build/tools/midl.py
common.copy /usr/local/share/boost-build/tools/notfile.py
common.copy /usr/local/share/boost-build/tools/darwin.jam
common.copy /usr/local/share/boost-build/tools/boostbook-config.jam
common.copy /usr/local/share/boost-build/tools/unix.jam
common.copy /usr/local/share/boost-build/tools/gfortran.jam
common.copy /usr/local/share/boost-build/tools/quickbook-config.jam
common.copy /usr/local/share/boost-build/tools/rc.py
common.copy /usr/local/share/boost-build/tools/pathscale.jam
common.copy /usr/local/share/boost-build/tools/como-win.jam
common.copy /usr/local/share/boost-build/tools/xsltproc.jam
common.copy /usr/local/share/boost-build/tools/unix.py
common.copy /usr/local/share/boost-build/tools/zlib.jam
common.copy /usr/local/share/boost-build/tools/mpi.jam
common.copy /usr/local/share/boost-build/tools/tiff.jam
common.copy /usr/local/share/boost-build/tools/hpfortran.jam
common.copy /usr/local/share/boost-build/tools/pch.jam
common.copy /usr/local/share/boost-build/tools/qt5.jam
common.copy /usr/local/share/boost-build/tools/whale.jam
common.copy /usr/local/share/boost-build/tools/hp_cxx.jam
common.copy /usr/local/share/boost-build/tools/gettext.jam
common.copy /usr/local/share/boost-build/tools/doxproc.py
common.copy /usr/local/share/boost-build/tools/common.py
common.copy /usr/local/share/boost-build/tools/intel-darwin.jam
common.copy /usr/local/share/boost-build/tools/builtin.jam
common.copy /usr/local/share/boost-build/tools/mipspro.jam
common.copy /usr/local/share/boost-build/tools/doxygen-config.jam
common.copy /usr/local/share/boost-build/tools/clang.jam
common.copy /usr/local/share/boost-build/tools/stlport.jam
common.copy /usr/local/share/boost-build/tools/notfile.jam
common.copy /usr/local/share/boost-build/tools/sun.jam
common.copy /usr/local/share/boost-build/tools/message.py
common.copy /usr/local/share/boost-build/tools/testing.py
common.copy /usr/local/share/boost-build/tools/msvc-config.jam
common.copy /usr/local/share/boost-build/tools/symlink.jam
common.copy /usr/local/share/boost-build/tools/jpeg.jam
common.copy /usr/local/share/boost-build/tools/boostbook.jam
common.copy /usr/local/share/boost-build/tools/xlf.jam
common.copy /usr/local/share/boost-build/tools/make.py
common.copy /usr/local/share/boost-build/tools/convert.jam
common.copy /usr/local/share/boost-build/tools/dmc.jam
common.copy /usr/local/share/boost-build/tools/cw-config.jam
common.copy /usr/local/share/boost-build/tools/darwin.py
common.copy /usr/local/share/boost-build/tools/fop.jam
common.copy /usr/local/share/boost-build/tools/builtin.py
common.copy /usr/local/share/boost-build/tools/intel-linux.jam
common.copy /usr/local/share/boost-build/tools/cray.jam
common.copy /usr/local/share/boost-build/tools/rc.jam
common.copy /usr/local/share/boost-build/tools/symlink.py
common.copy /usr/local/share/boost-build/tools/lex.jam
common.copy /usr/local/share/boost-build/tools/package.py
common.copy /usr/local/share/boost-build/tools/auto-index.jam
common.copy /usr/local/share/boost-build/tools/clang-linux.jam
common.copy /usr/local/share/boost-build/tools/stage.jam
common.copy /usr/local/share/boost-build/tools/generate.jam
common.copy /usr/local/share/boost-build/tools/bison.jam
common.copy /usr/local/share/boost-build/tools/qcc.jam
common.copy /usr/local/share/boost-build/tools/quickbook.jam
common.copy /usr/local/share/boost-build/tools/fortran.jam
common.copy /usr/local/share/boost-build/tools/package.jam
common.copy /usr/local/share/boost-build/tools/pgi.jam
...on 300th target...
common.copy /usr/local/share/boost-build/tools/midl.jam
common.copy /usr/local/share/boost-build/tools/como-linux.jam
common.copy /usr/local/share/boost-build/tools/vacpp.jam
common.copy /usr/local/share/boost-build/tools/qt3.jam
common.copy /usr/local/share/boost-build/tools/ifort.jam
common.copy /usr/local/share/boost-build/tools/qt.jam
common.copy /usr/local/share/boost-build/tools/acc.jam
...updated 306 targets...

这些jam文件是什么?我的标题和库文件在哪里?AFAIK gnu/linux默认库路径在/usr/include/usr/lib.

我对吗?如果是的话,他们为什么不在那里安装?它安装了吗?标题和库的位置在哪里?它们不应该也在路径中包含的地方吗?

希望你能为我澄清这个,因为我没有在网上找到任何为我做的事情.



1> Jacob Krieg..:

这是我做的快捷方式:

$ sudo ./bootstrap.sh --prefix=/usr/local
$ sudo ./b2 install 

将安装库和头文件/usr/local.头文件将被放入/usr/local/include并且库将被放入/usr/local/lib/./usr/local如果需要将路径安装在其他位置,请更改路径.

如果您需要,我推荐它,添加两个路径到PATH变量:

$ export PATH=$PATH:/usr/local/include/:/usr/local/lib/

要使其永久添加以上行到~/.profile文件.


“如果需要,我建议将这两个路径添加到PATH变量中”。那是完全错误的。
推荐阅读
保佑欣疼你的芯疼
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有