This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: duplicate definitions from linker


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


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