如何为新安装的Boost添加编译器包含路径和链接器库路径?
我有 RHEL 5.2,安装了 Boost 1.33。 我下载了boost_1_44_0.tar.bz2。并建造了它。完成后,它显示:
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/dfe/Archive/boost_1_44_0
The following directory should be added to linker library paths:
/home/dfe/Archive/boost_1_44_0/stage/lib
- 如何添加上述包含路径?
- 当我执行“rpm -q boost”时,它显示 boost-1.33.1-10.el5。当我安装了 1.44 版本后,为什么会这样?
- 有没有更好的方法来安装最新版本的Boost?
I have RHEL 5.2, with Boost 1.33 installed.
I downloaded boost_1_44_0.tar.bz2. and built it. On completion it showed:
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/dfe/Archive/boost_1_44_0
The following directory should be added to linker library paths:
/home/dfe/Archive/boost_1_44_0/stage/lib
- How do I add the above mentioned include paths?
- When I do "rpm -q boost", it shows boost-1.33.1-10.el5. Why is that so, when I've installed version 1.44?
- Is there a better way to install the latest version of Boost?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 Linux 系统上安装软件总是需要三个步骤:
您可能做了相当于
make
但没有执行与make install
相同的操作。 需要运行运行
./b2
后There are always three steps to install software on Linux systems:
You likely did the equivalent of
make
but did not do the equivalent ofmake install
. You need to runafter running
./b2
只需将路径添加到您的 .bashrc 或 .profile (或任何能让您漂浮的东西),如下所示:
Just add the paths to your .bashrc or .profile (or whatever floats your boat) like this:
您必须将这些目录包含到用于构建应用程序的 makefile 中
-I 选项 将 dir 添加到搜索 #include 文件的目录列表中。
-L 选项将 dir 添加到链接器搜索库的目录列表中
CC 是 sun 编译器...
You have to include these directories into makefile which you would use to build your application
-I option Adds dir to the list of directories that are searched for #include files.
-L option adds dir to the list of directories searched for libraries by linker
CC is sun compiler...
首先,我删除了现有的 boost rpm 使用
显示消息“错误:“boost”指定多个包”
然后尝试:(
我不记得我是否输入了“boost”或“boost-1.33.1-10.el5” ')
显示了具有依赖项的包。
我做了:
等等,然后做了:
这从我的系统中完全消除了提升。
然后我使用 tar -xvjf boost_1_44_0.tar.bz2 提取了 boost_1_44_0.tar.bz2 并运行 bootstrap:
然后运行 bjam 为:
就是这样! Boost 安装在我的系统上,并且我在编译程序时不必指定任何链接器选项!耶!
现在“rpm -q boost”命令显示没有安装任何软件包。
First, I removed the existing boost rpm using
A message is displayed saying "error: "boost" specifies multiple packages"
Then tried:
(I don't remember whether I typed 'boost' or 'boost-1.33.1-10.el5')
The packages with dependencies were shown.
I did:
and so on and then did:
This erased boost completely from my system.
Then I extracted boost_1_44_0.tar.bz2 using tar -xvjf boost_1_44_0.tar.bz2 and ran bootstrap with:
Then ran bjam as:
That's it! Boost got installed on my system, and I didn't have to specify any of the linker options while compiling programs! Yay!
Now the 'rpm -q boost' command shows that there is no package installed.