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


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

Re: Inlining problem


> The method "DeclareMatVar(MatPointVarID const &, MatPointVarID const &)"
> is declared as inline, and thus no symbol should be created when the
> method is being called. This of course leads to link errors.
>

"inline" is just a _hint_ to the compiler. It does not guarantee that
an outlined implementation will not be emitted somewhere, so if you
include a header file containg inline declarations the linker will get
confused.

You can use "#pragma interface"/"#pragma implementation" to ensure
that the compiler only attempts to emit an outlined implementation of
your method in one object file.

I would also suggest not pre-declaring inline functions if you want to
be sure they are inlined wherever possible. This is probibly why you
are seeing this problem.

regards

  [ bryce ]



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