bjam `无法找到名为“libboost_python”的文件或目标`
我的 Boost.Python 配置/安装中缺少什么?
我正在尝试编译教程示例,但出现 libboost_python
not found 错误
cd /usr/share/doc/libboost1.42-doc/examples/libs/python/example/tutorial
bjam
error: Unable to find file or target named
error: 'libboost_python'
error: referred from project at
error: '.'
,但库在那里,ldconfig.real
已运行:
/usr/lib/libboost_python.a -> libboost_python-py27.a
/usr/lib/libboost_python-mt-py26.a -> libboost_python-py26.a
/usr/lib/libboost_python-mt-py26.so -> libboost_python-py26.so.1.42.0
/usr/lib/libboost_python-mt-py27.a -> libboost_python-py27.a
/usr/lib/libboost_python-mt-py27.so -> libboost_python-py27.so.1.42.0
/usr/lib/libboost_python-py26.a
/usr/lib/libboost_python-py26.so -> libboost_python-py26.so.1.42.0
/usr/lib/libboost_python-py26.so.1.42.0
/usr/lib/libboost_python-py27.a
/usr/lib/libboost_python-py27.so -> libboost_python-py27.so.1.42.0
/usr/lib/libboost_python-py27.so.1.42.0
/usr/lib/libboost_python.so -> libboost_python-py27.so
我正在使用默认的 libboost Ubuntu 11.04 的软件包。
我的 user-config.jam
是
using python : 2.7 ;
What am I missing in my Boost.Python configuration/installation?
I'm trying to compile tutorial example, and I get error with libboost_python
not found
cd /usr/share/doc/libboost1.42-doc/examples/libs/python/example/tutorial
bjam
error: Unable to find file or target named
error: 'libboost_python'
error: referred from project at
error: '.'
But the library is there, ldconfig.real
has been run:
/usr/lib/libboost_python.a -> libboost_python-py27.a
/usr/lib/libboost_python-mt-py26.a -> libboost_python-py26.a
/usr/lib/libboost_python-mt-py26.so -> libboost_python-py26.so.1.42.0
/usr/lib/libboost_python-mt-py27.a -> libboost_python-py27.a
/usr/lib/libboost_python-mt-py27.so -> libboost_python-py27.so.1.42.0
/usr/lib/libboost_python-py26.a
/usr/lib/libboost_python-py26.so -> libboost_python-py26.so.1.42.0
/usr/lib/libboost_python-py26.so.1.42.0
/usr/lib/libboost_python-py27.a
/usr/lib/libboost_python-py27.so -> libboost_python-py27.so.1.42.0
/usr/lib/libboost_python-py27.so.1.42.0
/usr/lib/libboost_python.so -> libboost_python-py27.so
I'm using default libboost packages from Ubuntu 11.04.
My user-config.jam
is
using python : 2.7 ;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在 ubuntu 12.04 上遇到了类似的问题,我将所有 boost 库安装为一个包。我在这里找到了解决方案:
http://jayrambhia。 wordpress.com/2012/06/25/configuring-boostpython-and-hello-boost/
事实证明,你根本不需要使用bjam。一个 makefile 就足够了。我将在此处重复上述链接中的解决方案:
1.) 安装 libboost-python 包
2.) 创建一个名为“hello_ext.c”的 hello world 源文件:
3.) 创建一个 makefile:
4.) make
5. ) 即可使用。在Python中:
I had a similar problem on ubuntu 12.04 where I installed all the boost libraries as a package. I found the solution here:
http://jayrambhia.wordpress.com/2012/06/25/configuring-boostpython-and-hello-boost/
It turns out that you do not need to use bjam at all. A makefile suffices. I will repeat the the solution from the above link here:
1.) Install the libboost-python package
2.) Create a hello world source file called 'hello_ext.c':
3.) Create a makefile:
4.) make
5.) Ready to use. In python:
仍然不确定这是正确的方法,看起来有点黑客,但以下内容有所帮助:
在
Jamroot
文件中替换为
Still not sure it that's the proper way, seems little hackish, but following helped:
In
Jamroot
file replacedwith
您可以有一个类似以下内容的站点配置文件;
(你需要位,不知道为什么)
然后你可以做类似的事情。
从长远来看,这会让事情变得更容易,因为你不可避免地必须在某个时候更改升压版本。
You could have a site-config file with something like the following ;
(you need the < library > bit, not sure why)
then you can do stuff like.
Makes things easier in the long run, as you inevitably will have to change boost version at some point.