1 <?xml version="1.0" encoding="ISO-8859-1"?>
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8 <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
9 <meta name="KEYWORDS" content="libstdc++, libstdc++, GCC, g++" />
10 <meta name="DESCRIPTION" content="README for the GNU libstdc++ effort." />
11 <meta name="GENERATOR" content="vi and eight fingers" />
12 <title>libstdc++ Installation Instructions</title>
13 <link rel="StyleSheet" href="lib3styles.css" type="text/css" />
14 <link rel="Copyright" href="17_intro/license.html" type="text/html" />
18 <h1 class="centered"><a name="top">Getting started: configure, build, install</a></h1>
20 <p class="fineprint"><em>
21 The latest version of this document is always available at
22 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/install.html">
23 http://gcc.gnu.org/onlinedocs/libstdc++/install.html</a>.
27 To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++ homepage</a>.
31 <!-- ####################################################### -->
35 <p>Because libstdc++ is part of GCC, the primary source for
36 installation instructions is
37 <a href="http://gcc.gnu.org/install/">the GCC install page</a>.
38 Additional data is given here only where it applies to libstdc++.
42 <li><a href="#prereqs">Tools you will need beforehand</a></li>
43 <li><a href="#config">Configuring</a></li>
44 <li><a href="#usage">Using the library</a></li>
49 <!-- ####################################################### -->
51 <h2><a name="prereqs">Tools you will need beforehand</a></h2>
52 <p>The list of software needed to build the library is kept with the
53 rest of the compiler, at
54 <a href="http://gcc.gnu.org/install/prerequisites.html">
55 http://gcc.gnu.org/install/prerequisites.html</a>. The same page
56 also lists the tools you will need if you wish to modify the source.
59 <p>As of June 19, 2000, libstdc++ attempts to use tricky and
60 space-saving features of the GNU toolchain, enabled with
61 <code>-ffunction-sections -fdata-sections -Wl,--gc-sections</code>.
62 To obtain maximum benefit from this, binutils after this date should
63 also be used (bugs were fixed with C++ exception handling related
64 to this change in libstdc++). The version of these tools should
65 be <code>2.10.90</code>, or later, and you can get snapshots (as
66 well as releases) of binutils
67 <a href="ftp://sources.redhat.com/pub/binutils">here</a>. The
68 configure process will automatically detect and use these features
69 if the underlying support is present.
72 <p>Finally, a few system-specific requirements: </p>
76 <dd>If gcc 3.1.0 or later on is being used on linux, an attempt
77 will be made to use "C" library functionality necessary for C++
78 named locale support. For gcc 3.2.1 and later, this means that
79 glibc 2.2.5 or later is required and the "C" library de_DE locale
80 information must be installed.
83 Note however that the sanity checks involving the de_DE locale are
84 skipped when an explicit --enable-clocale=gnu configure option is
85 used: only the basic checks are carried out, defending against
90 If the 'gnu' locale model is being used, the following locales
91 are used and tested in the libstdc++ testsuites. The first column
92 is the name of the locale, the second is the character set it is
97 de_DE@euro ISO-8859-15
101 en_US.ISO-8859-1 ISO-8859-1
102 en_US.ISO-8859-15 ISO-8859-15
107 fr_FR@euro ISO-8859-15
115 <p>Failure to have the underlying "C" library locale
116 information installed will mean that C++ named locales for the
117 above regions will not work: because of this, the libstdc++
118 testsuite will skip the named locale tests. If this isn't an
119 issue, don't worry about it. If named locales are needed, the
120 underlying locale information must be installed. Note that
121 rebuilding libstdc++ after the "C" locales are installed is not
125 <p>To install support for locales, do only one of the following:
129 <li> install all locales
131 <li>with RedHat Linux:
132 <p> <code> export LC_ALL=C </code> </p>
133 <p> <code> rpm -e glibc-common --nodeps </code> </p>
134 <p> <code> rpm -i --define "_install_langs all"
135 glibc-common-2.2.5-34.i386.rpm </code> </p>
137 <li> (instructions for other operating systems solicited) </li>
140 <li> install just the necessary locales
142 <li>with Debian Linux:
143 <p> Add the above list, as shown, to the file
144 <code>/etc/locale.gen</code> </p>
145 <p> run <code>/usr/sbin/locale-gen</code> </p>
147 <li> on most Unix-like operating systems:
148 <p> <code> localedef -i de_DE -f ISO-8859-1 de_DE </code> </p>
149 <p> (repeat for each entry in the above list) </p>
151 <li> (instructions for other operating systems solicited) </li>
160 <h2><a name="config">Configuring</a></h2>
161 <p>If you have never done this before, you should read the basic
162 <a href="http://gcc.gnu.org/install/">GCC Installation
163 Instructions</a> first. Read <em>all of them</em>.
164 <strong>Twice.</strong>
166 <p>When building libstdc++ you'll have to configure
167 the entire <em>gccsrcdir</em> directory. The full list of libstdc++
168 specific configuration options, not dependent on the specific compiler
169 release being used, can be found <a href="configopts.html">here</a>.
171 <p>Consider possibly using --enable-languages=c++ to save time by only
172 building the C++ language parts.
176 cd <em>gccbuilddir</em>
177 <em>gccsrcdir</em>/configure --prefix=<em>destdir</em> --other-opts...</pre>
181 <h2><a name="usage">Using the library</a></h2>
182 <h3>Find the new library at runtime (shared linking only)</h3>
183 <p>If you only built a static library (libstdc++.a), or if you
184 specified static linking, you don't have to worry about this.
185 But if you built a shared library (libstdc++.so) and linked
186 against it, then you will need to find that library when you
189 <p>Methods vary for different platforms and different styles, but
190 the usual ones are printed to the screen during installation.
194 <li>At runtime set LD_LIBRARY_PATH in your environment correctly,
195 so that the shared library for libstdc++ can be found and
196 loaded. Be certain that you understand all of the other
197 implications and behavior of LD_LIBRARY_PATH first (few
198 people do, and they get into trouble).
200 <li>Compile the path to find the library at runtime into the
201 program. This can be done by passing certain options to g++,
202 which will in turn pass them on to the linker. The exact
203 format of the options is dependent on which linker you use:
205 <li>GNU ld (default on Linux):<code> -Wl,--rpath,<em>destdir</em>/lib</code></li>
206 <li>IRIX ld:<code> -Wl,-rpath,<em>destdir</em>/lib</code></li>
207 <li>Solaris ld:<code> -Wl,-R<em>destdir</em>/lib</code></li>
208 <li>More...? Let us know!</li>
212 <p>Use the <code>ldd(1)</code> utility to show which library the system
213 thinks it will get at runtime.
215 <p>A libstdc++.la file is also installed, for use with Libtool. If
216 you use Libtool to create your executables, these details are
217 taken care of for you.
223 <h2><a name=""></a></h2>
229 <!-- ####################################################### -->
232 <p class="fineprint"><em>
233 See <a href="17_intro/license.html">license.html</a> for copying conditions.
234 Comments and suggestions are welcome, and may be sent to
235 <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.