📄 index.txt
字号:
libstdc++ Frequently Asked Questions The latest version of this document is always available at [1]http://gcc.gnu.org/onlinedocs/libstdc++/faq/. The main documentation page is at [2]http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html. To the [3]libstdc++-v3 homepage. _________________________________________________________________ Questions 1. [4]General Information 1. [5]What is libstdc++-v3? 2. [6]Why should I use libstdc++? 3. [7]Who's in charge of it? 4. [8]How do I get libstdc++? 5. [9]When is libstdc++ going to be finished? 6. [10]How do I contribute to the effort? 7. [11]What happened to libg++? I need that! 8. [12]What if I have more questions? 9. [13]What are the license terms for libstdc++-v3? 2. [14]Installation 1. [15]How do I install libstdc++-v3? 2. [16][removed] 3. [17]What is this CVS thing that you keep mentioning? 4. [18]How do I know if it works? 5. [19]This library is HUGE! And what's libsupc++? 3. [20]Platform-Specific Issues 1. [21]Can libstdc++-v3 be used with <my favorite compiler>? 2. [22][removed] 3. [23][removed] 4. [24]I can't use 'long long' on Solaris 4. [25]Known Bugs and Non-Bugs 1. [26]What works already? 2. [27]Bugs in gcc/g++ (not libstdc++-v3) 3. [28]Bugs in the C++ language/lib specification 4. [29]Things in libstdc++ that look like bugs o [30]reopening a stream fails o [31]-Weffc++ complains too much o [32]"ambiguous overloads" after including an old-style header o [33]The g++-3 headers are not ours o [34]compilation errors from streambuf.h o [35]errors about *Cconcept and constraints in the STL... 5. [36]Aw, that's easy to fix! 5. [37]Miscellaneous 1. [38]string::iterator is not char*; vector<T>::iterator is not T* 2. [39]What's next after libstdc++-v3? 3. [40]What about the STL from SGI? 4. [41]Extensions and Backward Compatibility 5. [42][removed] 6. [43]Is libstdc++-v3 thread-safe? 7. [44]How do I get a copy of the ISO C++ Standard? 8. [45]What's an ABI and why is it so messy? _________________________________________________________________ 1.0 General Information1.1 What is libstdc++-v3? The GNU Standard C++ Library v3 is an ongoing project to implement the ISO 14882 Standard C++ library as described in chapters 17 through 27 and annex D. As the library reaches stable plateaus, it is captured in a snapshot and released. The current release is [46]the thirteenth snapshot. For those who want to see exactly how far the project has come, or just want the latest bleeding-edge code, the up-to-date source is available over anonymous CVS, and can even be browsed over the Web (see below). The older libstdc++-v2 project is no longer maintained; the code has been completely replaced and rewritten. [47]If you are using V2, then you need to report bugs to your system vendor, not to the V3 list. A more formal description of the V3 goals can be found in the official [48]design document. _________________________________________________________________1.2 Why should I use libstdc++? The completion of the ISO C++ standardization gave the C++ community a powerful set of reuseable tools in the form of the C++ Standard Library. However, all existing C++ implementations are (as the Draft Standard used to say) "incomplet and incorrekt," and many suffer from limitations of the compilers that use them. The GNU C/C++/FORTRAN/<pick-a-language> compiler (gcc, g++, etc) is widely considered to be one of the leading compilers in the world. Its development has recently been taken over by the [49]GCC team. All of the rapid development and near-legendary [50]portability that are the hallmarks of an open-source project are being applied to libstdc++. That means that all of the Standard classes and functions (such as string, vector<>, iostreams, and algorithms) will be freely available and fully compliant. Programmers will no longer need to "roll their own" nor be worried about platform-specific incompatibilities. _________________________________________________________________1.3 Who's in charge of it? The libstdc++ project is contributed to by several developers all over the world, in the same way as GCC or Linux. Benjamin Kosnik, Gabriel Dos Reis, Phil Edwards, and Ulrich Drepper are the lead maintainers of the CVS archive. Development and discussion is held on the libstdc++ mailing list. Subscribing to the list, or searching the list archives, is open to everyone. You can read instructions for doing so on the [51]homepage. If you have questions, ideas, code, or are just curious, sign up! _________________________________________________________________1.4 How do I get libstdc++? The thirteenth (and latest) snapshot of libstdc++-v3 is [52]available via ftp. The [53]homepage has instructions for retrieving the latest CVS sources, and for browsing the CVS sources over the web. The subset commonly known as the Standard Template Library (chapters 23 through 25, mostly) is adapted from the final release of the SGI STL. _________________________________________________________________1.5 When is libstdc++ going to be finished? Nathan Myers gave the best of all possible answers, responding to a Usenet article asking this question: Sooner, if you help. _________________________________________________________________1.6 How do I contribute to the effort? Here is [54]a page devoted to this topic. Subscribing to the mailing list (see above, or the homepage) is a very good idea if you have something to contribute, or if you have spare time and want to help. Contributions don't have to be in the form of source code; anybody who is willing to help write documentation, for example, or has found a bug in code that we all thought was working, is more than welcome! _________________________________________________________________1.7 What happened to libg++? I need that! The most recent libg++ README states that libg++ is no longer being actively maintained. It should not be used for new projects, and is only being kicked along to support older code. The libg++ was designed and created when there was no Standard to provide guidance. Classes like linked lists are now provided for by list<T> and do not need to be created by genclass. (For that matter, templates exist now and are well-supported, whereas genclass (mostly) predates them.) There are other classes in libg++ that are not specified in the ISO Standard (e.g., statistical analysis). While there are a lot of really useful things that are used by a lot of people (e.g., statistics :-), the Standards Committee couldn't include everything, and so a lot of those "obvious" classes didn't get included. Since libstdc++ is an implementation of the Standard Library, we have no plans at this time to include non-Standard utilities in the implementation, however handy they are. (The extensions provided in the SGI STL aren't maintained by us and don't get a lot of our attention, because they don't require a lot of our time.) It is entirely plausable that the "useful stuff" from libg++ might be extracted into an updated utilities library, but nobody has stated such a project yet. (The [55]Boost site houses free C++ libraries that do varying things, and happened to be started by members of the Standards Committee. Certain "useful stuff" classes will probably migrate there.) For the bold and/or desperate, the [56]GCC FAQ describes where to find the last libg++ source. _________________________________________________________________1.8 What if I have more questions? If you have read the README and RELEASE-NOTES files, and your question remains unanswered, then just ask the mailing list. At present, you do not need to be subscribed to the list to send a message to it. More information is available on the homepage (including how to browse the list archives); to send to the list, use [57]libstdc++@gcc.gnu.org. If you have a question that you think should be included here, or if you have a question about a question/answer here, contact [58]Phil Edwards or [59]Gabriel Dos Reis. _________________________________________________________________1.9 What are the license terms for libstdc++-v3? See [60]our license description for these and related questions. _________________________________________________________________ 2.0 Installation2.1 How do I install libstdc++-v3? Complete instructions are not given here (this is a FAQ, not an installation document), but the tools required are few: * A 3.x release of GCC. Note that building GCC is much easier and more automated than building the GCC 2.[78] series was. If you are using GCC 2.95, you can still build earlier snapshots of libstdc++. * GNU Make is recommended, but should not be required. * The GNU Autotools are needed if you are messing with the configury or makefiles. The file [61]documentation.html provides a good overview of the steps necessary to build, install, and use the library. Instructions for configuring the library with new flags such as --enable-threads are there also, as well as patches and instructions for working with GCC 2.95. The top-level install.html and [62]RELEASE-NOTES files contain the exact build and installation instructions. You may wish to browse those files over CVSweb ahead of time to get a feel for what's required. RELEASE-NOTES is located in the ".../docs/17_intro/" directory of the distribution. _________________________________________________________________2.2 [removed] This question has become moot and has been removed. The stub is here to preserve numbering (and hence links/bookmarks). _________________________________________________________________2.3 What is this CVS thing that you keep mentioning? The Concurrent Versions System is one of several revision control packages. It was selected for GNU projects because it's free (speech), free (beer), and very high quality. The [63]CVS entry in the GNU software catalogue has a better description as well as a [64]link to the makers of CVS. The "anonymous client checkout" feature of CVS is similar to anonymous FTP in that it allows anyone to retrieve the latest libstdc++ sources. After the first of April, American users will have a "/pharmacy" command-line option... _________________________________________________________________2.4 How do I know if it works? libstdc++-v3 comes with its own testsuite. You do not need to actually install the library ("make install") to run the testsuite. To run the testsuite on the library after building it, use "make check" while in your build directory. To run the testsuite on the library after building and installing it, use "make check-install" instead. If you find bugs in the testsuite programs themselves, or if you think of a new test program that should be added to the suite, please write up your idea and send it to the list! _________________________________________________________________2.4 This library is HUGE! And what's libsupc++? Usually the size of libraries on disk isn't noticeable. When a link editor (or simply "linker") pulls things from a static archive library, only the necessary object files are copied into your executable, not the entire library. Unfortunately, even if you only need a single function or variable from an object file, the entire object file is extracted. (There's nothing unique to C++ or libstdc++-v3 about this; it's just common behavior, given here for background reasons.) Some of the object files which make up libstdc++.a are rather large. If you create a statically-linked executable with -static, those large object files are suddenly part of your executable. Historically the best way around this was to only place a very few functions (often only a single one) in each source/object file; then extracting a single function is the same as extracting a single .o file. For libstdc++-v3 this is only possible to a certain extent; the object files in question contain template classes and template functions, pre-instantiated, and splitting those up causes severe maintenance headaches.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -