2013-02-28 60 views
1

我試圖在link之後構建boost.python。在無法構建Boost.Python

/home/kchaitanya/boost/boost_1_50_0/tools/build/v2/user-config.jam

using python : 2.6 : /usr/bin/python2.6 : /usr/include/python2.6 : /usr/lib/python2.6 : <python-debugging>on ;

: 當我嘗試使用./b2./bjam編譯,我得到這樣的錯誤:當我加入這一行

error: No best alternative for /python_for_extensions 
next alternative: required properties: <python>2.6 <target-os>linux 
    matched 
next alternative: required properties: <python>2.6 <target-os>linux 
    matched 

錯誤消失

但是,現在編譯時,我得到編譯時錯誤的不能找到頭文件。就在錯誤的小摘錄:

...patience... 
...patience... 
...found 1548 targets... 
...updating 62 targets... 
gcc.compile.c++ bin.v2/libs/python/build/gcc-4.1.2/release/link-static/threading multi/numeric.o 

In file included from ./boost/python/detail/prefix.hpp:13, 
      from ./boost/python/numeric.hpp:8, 
      from libs/python/src/numeric.cpp:6: 
./boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory 
./boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No such file or directory 
./boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2 or higher is required for 
./boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No such file or directory 
./boost/python/instance_holder.hpp:34: error: ‘PyObject’ has not been declared 
./boost/python/instance_holder.hpp:41: error: expected ‘;’ before ‘(’ token 
./boost/python/instance_holder.hpp:45: error: ‘PyObject’ has not been declared 
./boost/python/detail/wrapper_base.hpp:21: error: expected initializer before ‘*’ token 
./boost/python/detail/wrapper_base.hpp:23: error: expected initializer before ‘*’ token 

需要幫助建設這個Boost.Python的。

+0

但是,實際上蟒蛇已經安裝在我的系統吧? – Chaitanya 2013-03-01 05:19:10

+0

我試着安裝'python-devel'。但是,它不能解決我的問題。它再一次給出了同樣的舊錯誤。 – Chaitanya 2013-03-01 05:39:37

回答

3

問題是沒有安裝對應於我的python版本的python-develpython-dev包。

在我的情況是這樣python2.6的

sudo yum install python26-devel的伎倆。

+0

sudo yum install -y python27-devel,也試過python2.7 pthon-2.7都給出了同樣的信息沒有包python-2.7-devel可用。在我的redhat 7.嘗試找到它:yum search python | grep -i devel:http://stackoverflow.com/questions/23215535/how-to-install-python27-devel-on-centos-6-5 – 2016-10-21 17:57:59

1

我在我的項目中有類似的問題,以上都無濟於事。我正在交叉編譯python和boost,實際問題是在配置中使用了'using python:'(其中一個存在於project-config.jam中,在執行bootstrap.sh/bat之後,我試圖添加另一個python配置自己到一個user-config.jam)。 http://comments.gmane.org/gmane.comp.lib.boost.build/22088

這裏:

該解決方案在這裏被描述 https://groups.google.com/forum/#!topic/boost-developers-archive/namMFSO_6Rg