OONumerics User : |
From: Jochen Härdtlein (haerdtlein_at_[hidden])
Date: 2006-01-20 01:28:40
------------------------------
Message: 4
Date: Tue, 17 Jan 2006 15:18:06 +0000
From: Nguyen Xuan Son <nguyenxuanson_at_[hidden]>
Subject: [oon-list] Barton-Nackman and compilation under Solaris
To: oon-list_at_[hidden]
Message-ID:
<884aa930601170718v282fae7dl5e73d8559a386693_at_[hidden]>
Content-Type: text/plain; charset="iso-8859-1"
Dear group readers,
I use the Barton-Nackman trick in my code, and I can compile it correctly
with Visual Studio 7.0 but have problem when trying to cmpile Sun Solaris
Compiler CC, the problem comes from the following line of code, the
error is
"multiple decoration for PdeSolver2D". I hope that you have had a solution
for the problem otherwise I will have to recoding to remove the template.
class MYDERIVEDCLASS:public MYBASECLASS<MYDERIVEDCLASS>
{
friend class MYBASECLASS;
....
}
Where I have define the base class as:
template<typename ADerivedSolver> class MYBASECLASS
{
...
}
Hope to hear from you soon.
Regards,
Xuan Son
Dear Xuan Son,
since your class MYBASECLASS is a templated class, you need to specify
the type of its template in the friend declaration. Replacing your
friend declaration by
friend class MYBASECLASS <MYDERIVEDCLASS>;
should solve the problem!
Actually, the Visual Studio 7.0 compiler should not have compiled that
code neither!
Best,
Jochen