gpt4 book ai didi

c++ - Ubuntu 10.04 中的 Boost.Python 教程

转载 作者:搜寻专家 更新时间:2023-10-31 00:05:09 26 4
gpt4 key购买 nike

我下载了最新版本的 Boost,我正在尝试在 Ubuntu 10.04 上启动和运行 Boost.python 教程:http://www.boost.org/doc/libs/1_43_0/libs/python/doc/tutorial/doc/html/python/hello.html

我导航到正确的目录,运行“bjam”并使用默认设置进行编译。我还没有创建 bjam 配置文件。编译似乎有效,但现在我不知道如何将这些文件包含在我的 python 脚本中。当我尝试运行 python hello world 脚本时,它给了我这个错误:

Traceback (most recent call last):
File "./hello.py", line 6, in <module>
import hello_ext
ImportError: libboost_python.so.1.43.0: cannot open shared object file: No such file or directory

有人知道这是怎么回事吗?

最佳答案

你是如何安装 boost 的?假设您使用了以下内容:http://www.boost.org/doc/libs/1_43_0/more/getting_started/unix-variants.html#easy-build-and-install

liboost_python 分片库将安装在/usr/local/lib

要运行 hello.py 示例,请尝试以下操作:

LD_LIBRARY_PATH=/usr/local/lib python ./hello.py

关于c++ - Ubuntu 10.04 中的 Boost.Python 教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3009533/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com