generic way to access C++ libs?

Diez B. Roggisch deetsNOSPAM at web.de
Wed Nov 10 06:15:25 EST 2004


> Remember that "inline" (and the implicit inline you generate by
> _defining_ the method in the class itself) is merely a hint to the
> compiler, which the compiler is perfectly entitled to ignore. One
> situation in which the compiler is _guaranteed_ to ignore it is if you
> also declare the method to be virtual, for example. In general, it may
> choose to inlne some of the calls while not others.
> 
> I don't think that declaring a function to be inline makes any
> guarantess about whether you will find a symbol for that function in
> the object code. But the ODR guarantees that sorting this mess out is
> the compiler's problem, not yours.

You are right -  I just created a test-project with two object files that
stem from .cc-files where the same class with an inlined  function "bar" is
included. What happens is that nm shows me that the function "bar" is
defined weak - according to nm (and what I understand about that) this
means that in presence of another symbol of that name, it will be ignored.
So both files contain a definition for bar, but the linker is able to sort
it out.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list