在Ubuntu上使用Boost [英] Using Boost on ubuntu

查看:347
本文介绍了在Ubuntu上使用Boost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经听说了很多关于过去升压很好的意见,我想我会试试看。于是我下载了包管理器的所有需要​​的软件包在Ubuntu 9.04。现在,我有麻烦找出如何实际使用织补库。

I've heard a lot of good comments about Boost in the past and thought I would give it a try. So I downloaded all the required packages from the package manager in Ubuntu 9.04. Now I'm having trouble finding out how to actually use the darn libraries.

有谁知道上加速了良好的教程,去一路从世界您好到高级主题,并且还介绍了如何在Ubuntu上使用G ++编译的程序?

Does anyone know of a good tutorial on Boost that goes all the way from Hello World to Advanced Topics, and also covers how to compile programs using g++ on ubuntu?

推荐答案

同意; 升压网站有大部分好的教程,通过分库打破。

Agreed; the boost website has good tutorials for the most part, broken down by sub-library.

至于编译时,库实现良好的80%,在头文件中定义,使得编译微不足道。例如,如果你想使用的shared_ptr的,你只需要添加

As for compiling, a good 80% of the library implementation is defined in the header files, making compiling trivial. for example, if you wanted to use shared_ptr's, you'd just add

#include <boost/shared_ptr.hpp>

和编译,你通常会。无需库路径添加到您的g ++命令,或-llibboost指定。只要升压目录在include路径,你所有的设置。

and compile as you normally would. No need to add library paths to your g++ command, or specify -llibboost. As long as the boost directory is in your include path, you're all set.

从升压文档:

这需要编译和链接的唯一库具备以下条件:必须单独建造的唯一Boost库是:

The only libraries that need to be compiled and linked are the following:The only Boost libraries that must be built separately are:


      
  • Boost.Filesystem的

  •   
  • 了Boost.Iostreams

  •   
  • Boost.ProgramOptions

  •   
  • Boost.Python的(参见Boost.Python的建设和安装前建立的文档)

  •   
  • Boost.Regex ​​

  •   
  • Boost.Serialization

  •   
  • Boost.Signals

  •   
  • Boost.Thread

  •   
  • Boost.Wave

  •   

一些库具有可选的单独编译的二进制文件:

A few libraries have optional separately-compiled binaries:


      
  • Boost.DateTime有,如果你使用它的to_string / from_string或序列号的功能,只需要一个二进制组件,或者如果你的目标的Visual C ++ 6.x或Borland的。

  •   
  • Boost.Graph也有,如果你打算解析GraphViz的文件只需要一个二进制组件。

  •   
  • Boost.Test可以在仅标头或单独编译模式,虽然独立编译建议使用严重。

  •   

所以,如果你正在使用的上市图书馆之一,使用的入门指南,好了,让你开始编译和链接来提高。

So, if you're using one of the listed libraries, use the Getting Started guide to, well, get you started on compiling and linking to Boost.

这篇关于在Ubuntu上使用Boost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆