duplicate definitions from linker

Eljay Love-Jensen eljay@adobe.com
Mon Dec 16 07:16:00 GMT 2002


Hi Alf,

Style point.  For your file arrangement, A.hxx should include B.hxx, and 
not (IMO) put A::func as an inline in the B.hxx file.  As you have it, I 
presume that B.hxx includes A.hxx, because A::func needs to be aware of 
it's declaration.

But that immaterial as to your issue regarding duplicate definitions.  It's 
possible that A::func's body is too complicated to inline.  Remember, 
"inline" is only a suggestion.

As a temporary cure, it may behoove you to move A::func into your A.cxx 
file as a non-inline (outline? normal?  hmmm, what's the term?) method.

Could you include a minimal code snippet that demonstrates this 
problem?  And what platform are you using GCC 3.2 on?

Thanks,
--Eljay



More information about the Gcc-help mailing list