2010-09-30 43 views
16

我的Ubuntu 10.04,想安裝最新的Boost庫1.44_0安裝最新的1.44 Boost庫ubuntu下10.04

我下載的tar.gz文件解壓縮和它到/ usr /本地/ boost_1_44_0

我已經從突觸中安裝了1.40版本的安裝程序。

所以我想編譯並鏈接到1.44因爲我想使用一些新的庫, 不屬於舊版本,如屬性樹。

但是,我遇到了一些問題。

冉須藤./bootstrap.sh(即都很好)

冉./bjam用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 
... 

儘管我沒有使用bzip2,所以我並不擔心。

但是之後在編譯過程中很短的時間內,出現了充滿錯誤的屏幕。 這裏列出的太多,但他們通常在名稱中有python。

... 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:error: 「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 

首先,爲什麼有這麼多的錯誤未聲明? 還有其他的太多太多了,在這裏列出。

但我的主要問題是,我想鏈接到庫,但它們沒有放置在預期的位置。我以爲他們會在boost_1_44_0/libs中,但他們沒有找到。 我確實發現了一些散佈在周圍的.a文件。

我剛剛構建這整個事情是錯的?

+0

好吧,我清空了整個事情,重新開始。我添加了bootstrap參數來告訴它將include包括在/ usr/local/boost/include和/ usr/local/boost/lib中。還將--layout = system選項添加到bjam命令行。文件似乎在那裏。還有構建錯誤,但大多數東西似乎在那裏。將嘗試連接明天... – Matt 2010-09-30 10:15:53

回答

34

您在這裏錯過的是bz2 Boost Python庫特別依賴的庫。首先使用以下命令安裝此庫 - sudo apt-get install libbz2-dev

+1

謝謝,它也有助於刪除舊的助推庫。 – Matt 2010-09-30 22:19:09

+1

它幫了很多! – Greg 2011-07-28 14:03:06

+0

我的經驗編譯boost 1.60我不得不同時安裝'python-dev'和'libbz2-dev',以便它能夠乾淨地構建。 – MatrixManAtYrService 2016-02-06 15:58:23