This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using PCH branch to make precompiled std include


On Mon, Dec 16, 2002 at 10:44:58PM +0100, Paolo Carlini wrote:
> I tried, and it's really fast... when it works ;-)
> 
> paolo:~> more header.h
> #include <string>
> #include <iostream>
> paolo:~> more test2.cc
> #include "header.h"
> 
> int main()
> {
>  std::string str = "Paolo";
>  //char* str = "Paolo";
> 
>  std::cout << str << '\n';
> }
> paolo:~> g++ test2.cc
> /tmp/ccSZfk3p.o: In function `main':
> /tmp/ccSZfk3p.o(.text+0x18): undefined reference to 
> `std::allocator<char>::allocator[in-charge]()'
> ...
> collect2: ld returned 1 exit status

Let me guess wildly at what's happening here.  The basic_string<> 
constructor and destructor refer to std::allocator, which hasn't 
explicitly been included here.  It may be that either the PCH 
apparatus needs to be smarter about revealing definitions needed 
(transitively) by other standard headers, or we need to be more 
thorough about explicitly sub-including in standard headers the other
headers it takes to use one.

Nathan Myers
ncm-nospam@cantrip.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]