Re: where do inlined functions go?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 5 Dec 2005 12:47 am, Brian Dessent wrote:
> 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

This is what I have done. The method definition is in the class definition in 
the header file.  The methods are neither in-lined nor is their generated 
code to link to.

-- 
Anthony Shipman                    Mamas don't let your babies 
als@xxxxxxxxxxxx                   grow up to be outsourced.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux