Date: Thu, 26 Nov 1998 09:45:52 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Michael Schuster cc: djgpp AT delorie DOT com Subject: Re: string class In-Reply-To: <19981125.15040516@eev6.eev> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Wed, 25 Nov 1998, Michael Schuster wrote: > The solving was done by Jorge Ivan Meza Martinez who finally found > that you have to compile with gxx test.cc -O2 -lgpp > because the String constructor is declared as inline which is not > expanded before using optimization -O2 ( a bad thing I think) > > Perhaps Eli/Dj could you explain this in the faq? It's already in the FAQ. Here's an excerpt: 8.10 Some functions still not found in C++ programs =================================================== **Q*: I put all the libraries in the above order, but the linker still can't find some C++ functions from `complex.h' and `iostream.h.'* [...] *A*: Some C++ functions are declared `inline' and defined on header files. However, GCC won't inline them unless you compile with optimizations enabled, so it tries to find the compiled version of the functions in the library. Workaround: compile with `-O'. There's also this entry in the Index: * GCC won't find inline functions without -O: Section 8.10. Granted, the above doesn't mention the String class explicitly, but I don't think it is reasonable to expect the FAQ to mention every possible case of such problems. After all, a FAQ is not a Knowledge Base (even though the DJGPP FAQ sometimes looks like one ;-).