2012-03-28 01:13:14 +02:00
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2014-09-21 19:33:12 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns = "http://www.w3.org/1999/xhtml" > < head > < meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" / > < title > Chapter 3. Using< / title > < meta name = "generator" content = "DocBook XSL-NS Stylesheets V1.78.1" / > < meta name = "keywords" content = "ISO C++, library" / > < meta name = "keywords" content = "ISO C++, runtime, library" / > < link rel = "home" href = "../index.html" title = "The GNU C++ Library" / > < link rel = "up" href = "intro.html" title = "Part I. Introduction" / > < link rel = "prev" href = "make.html" title = "Make" / > < link rel = "next" href = "using_headers.html" title = "Headers" / > < / head > < body > < div class = "navheader" > < table width = "100%" summary = "Navigation header" > < tr > < th colspan = "3" align = "center" > Chapter 3. Using< / th > < / tr > < tr > < td width = "20%" align = "left" > < a accesskey = "p" href = "make.html" > Prev< / a > < / td > < th width = "60%" align = "center" > Part I.
2012-03-28 01:13:14 +02:00
Introduction
2015-08-28 17:33:40 +02:00
< / th > < td width = "20%" align = "right" > < a accesskey = "n" href = "using_headers.html" > Next< / a > < / td > < / tr > < / table > < hr / > < / div > < div class = "chapter" > < div class = "titlepage" > < div > < div > < h2 class = "title" > < a id = "manual.intro.using" > < / a > Chapter 3. Using< / h2 > < / div > < / div > < / div > < div class = "toc" > < p > < strong > Table of Contents< / strong > < / p > < dl class = "toc" > < dt > < span class = "section" > < a href = "using.html#manual.intro.using.flags" > Command Options< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_headers.html" > Headers< / a > < / span > < / dt > < dd > < dl > < dt > < span class = "section" > < a href = "using_headers.html#manual.intro.using.headers.all" > Header Files< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_headers.html#manual.intro.using.headers.mixing" > Mixing Headers< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_headers.html#manual.intro.using.headers.cheaders" > The C Headers and < code class = "code" > namespace std< / code > < / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_headers.html#manual.intro.using.headers.pre" > Precompiled Headers< / a > < / span > < / dt > < / dl > < / dd > < dt > < span class = "section" > < a href = "using_macros.html" > Macros< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_dual_abi.html" > Dual ABI< / a > < / span > < / dt > < dd > < dl > < dt > < span class = "section" > < a href = "using_dual_abi.html#manual.intro.using.abi.trouble" > Troubleshooting< / a > < / span > < / dt > < / dl > < / dd > < dt > < span class = "section" > < a href = "using_namespaces.html" > Namespaces< / a > < / span > < / dt > < dd > < dl > < dt > < span class = "section" > < a href = "using_namespaces.html#manual.intro.using.namespaces.all" > Available Namespaces< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_namespaces.html#manual.intro.using.namespaces.std" > namespace std< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_namespaces.html#manual.intro.using.namespaces.comp" > Using Namespace Composition< / a > < / span > < / dt > < / dl > < / dd > < dt > < span class = "section" > < a href = "using_dynamic_or_shared.html" > Linking< / a > < / span > < / dt > < dd > < dl > < dt > < span class = "section" > < a href = "using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding" > Almost Nothing< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic" > Finding Dynamic or Shared Libraries< / a > < / span > < / dt > < / dl > < / dd > < dt > < span class = "section" > < a href = "using_concurrency.html" > Concurrency< / a > < / span > < / dt > < dd > < dl > < dt > < span class = "section" > < a href = "using_concurrency.html#manual.intro.using.concurrency.prereq" > Prerequisites< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_concurrency.html#manual.intro.using.concurrency.thread_safety" > Thread Safety< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_concurrency.html#manual.intro.using.concurrency.atomics" > Atomics< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_concurrency.html#manual.intro.using.concurrency.io" > IO< / a > < / span > < / dt > < dd > < dl > < dt > < span class = "section" > < a href = "using_concurrency.html#concurrency.io.structure" > Structure< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_concurrency.html#concurrency.io.defaults" > Defaults< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_concurrency.html#concurrency.io.future" > Future< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_concurrency.html#concurrency.io.alt" > Alternatives< / a > < / span > < / dt > < / dl > < / dd > < dt > < span class = "section" > < a href = "using_concurrency.html#manual.intro.using.concurrency.containers" > Containers< / a > < / span > < / dt > < / dl > < / dd > < dt > < span class = "section" > < a href = "using_exceptions.html" > Exceptions< / a > < / span > < / dt > < dd > < dl > < dt > < span class = "section" > < a href = "using_exceptions.html#intro.using.exception.safety" > Exception Safety< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_exceptions.html#intro.using.exception.propagating" > Exception Neutrality< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_exceptions.html#intro.using.exception.no" > Doing without< / a > < / span > < / dt > < dt > < span class = "section" > < a href = "using_exceptions.html#intro.using.exception.compat" > Compatibility< / a > < / span > < / dt > < dd > < dl > < dt > < span class = "section" > < a href = "using_exceptions.html#using.exception.compat.c" > With < code class = "literal" > C< / code > < / a > < / span > < /
The set of features available in the GNU C++ library is shaped by
2014-09-21 19:33:12 +02:00
several < a class = "link" href = "http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Invoking-GCC.html" target = "_top" > GCC
2012-03-28 01:13:14 +02:00
Command Options< / a > . Options that impact libstdc++ are
enumerated and detailed in the table below.
< / p > < p >
By default, < span class = "command" > < strong > g++< / strong > < / span > is equivalent to < span class = "command" > < strong > g++ -std=gnu++98< / strong > < / span > . The standard library also defaults to this dialect.
2015-08-28 17:33:40 +02:00
< / p > < div class = "table" > < a id = "table.cmd_options" > < / a > < p class = "title" > < strong > Table 3.1. C++ Command Options< / strong > < / p > < div class = "table-contents" > < table summary = "C++ Command Options" border = "1" > < colgroup > < col align = "left" class = "c1" / > < col align = "left" class = "c2" / > < / colgroup > < thead > < tr > < th align = "left" > Option Flags< / th > < th align = "left" > Description< / th > < / tr > < / thead > < tbody > < tr > < td align = "left" > < code class = "literal" > -std=c++98< / code > < / td > < td align = "left" > Use the 1998 ISO C++ standard plus amendments.< / td > < / tr > < tr > < td align = "left" > < code class = "literal" > -std=gnu++98< / code > < / td > < td align = "left" > As directly above, with GNU extensions.< / td > < / tr > < tr > < td align = "left" > < code class = "literal" > -std=c++11< / code > < / td > < td align = "left" > Use the 2011 ISO C++ standard.< / td > < / tr > < tr > < td align = "left" > < code class = "literal" > -std=gnu++11< / code > < / td > < td align = "left" > As directly above, with GNU extensions.< / td > < / tr > < tr > < td align = "left" > < code class = "literal" > -fexceptions< / code > < / td > < td align = "left" > See < a class = "link" href = "using_exceptions.html#intro.using.exception.no" title = "Doing without" > exception-free dialect< / a > < / td > < / tr > < tr > < td align = "left" > < code class = "literal" > -frtti< / code > < / td > < td align = "left" > As above, but RTTI-free dialect.< / td > < / tr > < tr > < td align = "left" > < code class = "literal" > -pthread< / code > or < code class = "literal" > -pthreads< / code > < / td > < td align = "left" > For ISO C++11
< code class = "filename" > < thread> < / code > ,
< code class = "filename" > < future> < / code > ,
< code class = "filename" > < mutex> < / code > ,
or < code class = "filename" > < condition_variable> < / code > .
< / td > < / tr > < tr > < td align = "left" > < code class = "literal" > -latomic< / code > < / td > < td align = "left" > Linking to < code class = "filename" > libatomic< / code >
is required for some uses of ISO C++11
< code class = "filename" > < atomic> < / code > .
< / td > < / tr > < tr > < td align = "left" > < code class = "literal" > -fopenmp< / code > < / td > < td align = "left" > For < a class = "link" href = "parallel_mode.html" title = "Chapter 18. Parallel Mode" > parallel< / a > mode.< / td > < / tr > < / tbody > < / table > < / div > < / div > < br class = "table-break" / > < / div > < / div > < div class = "navfooter" > < hr / > < table width = "100%" summary = "Navigation footer" > < tr > < td width = "40%" align = "left" > < a accesskey = "p" href = "make.html" > Prev< / a > < / td > < td width = "20%" align = "center" > < a accesskey = "u" href = "intro.html" > Up< / a > < / td > < td width = "40%" align = "right" > < a accesskey = "n" href = "using_headers.html" > Next< / a > < / td > < / tr > < tr > < td width = "40%" align = "left" valign = "top" > Make < / td > < td width = "20%" align = "center" > < a accesskey = "h" href = "../index.html" > Home< / a > < / td > < td width = "40%" align = "right" valign = "top" > Headers< / td > < / tr > < / table > < / div > < / body > < / html >