【问题标题】:Does boost need special python module to build in linux [duplicate]boost是否需要特殊的python模块才能在linux中构建[重复]
【发布时间】:2016-05-10 07:43:48
【问题描述】:

我正在尝试在 Fedora 23 中构建 moduler-boost。我已经安装了 gcc-c++python 2.7

但它仍然给出这个错误,你知道吗?

    "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -m64  -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DBOOST_PYTHON_STATIC_LIB -DNDEBUG  -I"." -I"/usr/include/python2.7" -c -o "bin.v2/libs/python/build/gcc-5.3.1/release/link-static/threading-multi/exec.o" "libs/python/src/exec.cpp"

...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-5.3.1/release/link-static/threading-multi/exec.o...
gcc.compile.c++ bin.v2/libs/python/build/gcc-5.3.1/release/link-static/threading-multi/object/function_doc_signature.o
In file included from ./boost/python/detail/prefix.hpp:13:0,
                 from ./boost/python/converter/registrations.hpp:8,
                 from libs/python/src/object/function_doc_signature.cpp:9:
./boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
compilation terminated.

【问题讨论】:

  • 你安装python的开发包了吗?
  • 不,我没有,为什么需要开发包?
  • 发行版通常将程序拆分为二进制文件(我只是想使用它的东西)和与开发相关的东西。安装 python 可以获得二进制文件,安装类似于 python-dev (ubuntu et al) 或 python-devel (opensuse, centos , ...) 为您提供开发标头等。
  • 为了将来参考,我建议您在发布之前尝试例如谷歌搜索有问题的实际错误。在这种情况下,“./boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory”会产生很多答案。
  • 感谢您的指点!我很难过为什么 boost build doc (boost.org/build/doc/html) 没有提到任何关于 python-dev 的内容

标签: python c++ linux boost


【解决方案1】:

由于您已经指定了要构建的 Python 版本的路径,我猜您缺少 Python 的开发者头文件。

在 ubuntu 上,安装 python-dev,或者更具体地说,安装 libpython2.7-dev。

【讨论】:

  • 不,我没有。我该怎么做?
猜你喜欢
  • 1970-01-01
  • 2010-09-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-11
  • 2018-07-24
  • 1970-01-01
相关资源
最近更新 更多