Date: Mon, 30 Nov 1998 14:29:35 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Manni Heumann cc: djgpp AT delorie DOT com Subject: Re: string class In-Reply-To: <36627dc3.0@news.uni-bielefeld.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Mon, 30 Nov 1998, Manni Heumann wrote: > Running the compiler without the commandline switches necessary for inlining, > the compiler, of course, will not do the inlining. > > What now? If I understand the situation correctly, there should be another copy of the same functions in the library. (At least this is how things are required to work in C, I'm not sure about C++.) This way, if you compile with -O, you get the inlined version; if not, you get the non-inlined version from the library. > In any case the functions should have been compiled. And, inlined or > not, they should be available in the file where I included the header. > Then why doesn't the linker see them right there? Because the compiler didn't compile them into any code. Inline functions are like macros: they get spliced into every place that uses them, and otherwise disappear from existence. But if some other class called by your program (whose source wasn't submitted to the compiler) needs to call some String function, the linker cannot resolve that call. I guess -fkeep-inline-functions option might be an alternative to compiling with -O.