Inlining problem

Bryce McKinlay bryce@albatross.co.nz
Wed Jan 3 23:31:00 GMT 2001


> 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 ]




More information about the Gcc mailing list