This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: where do inlined functions go?
- From: Brian Dessent <brian at dessent dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 04 Dec 2005 05:47:52 -0800
- Subject: Re: where do inlined functions go?
- References: <200512050011.04484.als@iinet.net.au>
Anthony Shipman wrote:
> I've got a class with some methods defined in the class. The compiler does not
> generate object code for these methods. Then in a program that uses the class
> it fails to inline the methods and the linker fails with undefined functions.
> All files are compiled with the same command line options:
http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
The compiler can only inline the function if its definition is available
in the translation unit where it is called. This normally means you
have to put the function definition in a header file and include that
header in every source file.
Brian