C++ 在 ubuntu 10.04 下安装最新的 1.44 boost 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3829421/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing latest 1.44 boost library under ubuntu 10.04
提问by Matt
I have ubuntu 10.04 and want to install the latest boost library 1.44_0
我有 ubuntu 10.04,想安装最新的 boost 库 1.44_0
I downloaded the tar.gz file and unpacked it into /usr/local/boost_1_44_0
我下载了 tar.gz 文件并将其解压到 /usr/local/boost_1_44_0
I already have the boost 1.40 version install from synaptic.
我已经从突触安装了 boost 1.40 版本。
So I want to compile and link against 1.44 because I'm wanting to use some new libraries that are not in the older version such as the property tree.
所以我想针对 1.44 进行编译和链接,因为我想使用一些旧版本中没有的新库,例如属性树。
But, I'm having some issues getting it going.
但是,我在让它运行时遇到了一些问题。
Ran sudo ./bootstrap.sh (that went fine)
Ran sudo ./bootstrap.sh(一切顺利)
Ran ./bjam install There were errors with bzip2.
Ran ./bjam install bzip2 有错误。
gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.4.3/release/threading-multi/file_descriptor.o
gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.4.3/release/threading-multi/mapped_file.o
gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.4.3/release/threading-multi/zlib.o
gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.4.3/release/threading-multi/gzip.o
gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.4.3/release/threading-multi/bzip2.o
libs/iostreams/src/bzip2.cpp:20:56: error: bzlib.h: No such file or directory
libs/iostreams/src/bzip2.cpp:31: error: ‘BZ_OK' was not declared in this scope
libs/iostreams/src/bzip2.cpp:32: error: ‘BZ_RUN_OK' was not declared in this scope
...
Although I'm not using bzip2 so I'm not worried.
虽然我没有使用 bzip2,所以我并不担心。
But then a short time later during the compile, screens full of errors appear. Too many to list here, but they often have python in the name.
但是不久之后,在编译过程中,就会出现满是错误的屏幕。太多无法在此列出,但它们的名称中通常包含 python。
... on::list]': ./boost/python/str.hpp:285: instantiated from ‘boost::python::str boost::python::str::join(const T&) const [with T = boost::python::list]' libs/python/src/object/function_doc_signature.cpp:321: instantiated from here ./boost/python/object_core.hpp:334: error: ‘object_base_initializer' was not declared in this scope
... on::list]': ./boost/python/str.hpp:285: 实例化自 'boost::python::str boost::python::str::join(const T&) const [with T = boost::python::list]' libs/python/src/object/function_doc_signature.cpp:321: 从这里实例化 ./boost/python/object_core.hpp:334: 错误: 'object_base_initializer' 未在此范围内声明
"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -I"/usr/include/python2.6" -c -o "bin.v2/libs/python/build/gcc-4.4.3/release/threading-multi/object/function_doc_signature.o" "libs/python/src/object/function_doc_signature.cpp"
...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-4.4.3/release/threading-multi/object/function_doc_signature.o...
...skipped <pstage/lib>libboost_python.so.1.44.0 for lack of <pbin.v2/libs/python/build/gcc-4.4.3/release/threading-multi>numeric.o...
...skipped <pstage/lib>libboost_python.so for lack of <pstage/lib>libboost_python.so.1.44.0...
gcc.compile.c++ bin.v2/libs/random/build/gcc-4.4.3/release/threading-multi/random_device.o
First off, why so many errors? There are other ones too and too many to list here.
首先,为什么这么多错误?还有其他的太多了,无法在此列出。
But the main issue I have is that I want to link to the libraries, but they are not placed where expected. I thought they would be in boost_1_44_0/libs, but they are not found. I did find some .a files scattered around though.
但我的主要问题是我想链接到库,但它们没有放在预期的位置。我以为它们会在 boost_1_44_0/libs 中,但没有找到。不过我确实发现了一些分散的 .a 文件。
Am I just building this whole thing wrong?
我只是把整个事情都搞错了吗?
回答by
回答by BTB
You can download the latest boost binary for ubuntu from here: https://launchpad.net/~boost-latest/+archive/ppa
您可以从这里下载 ubuntu 的最新 boost 二进制文件:https: //launchpad.net/~boost-latest/+archive/ppa