[Dune] Hint: problem in mpihelper

Oliver Sander sander at mi.fu-berlin.de
Tue Sep 26 17:10:13 CEST 2006


Hi Bernard, hi Dune!

Static member variables should not be defined in headers.  Instead,
an mpihelper.cc is needed which contains the definitions and is
compiled to become a part of libcommon.

Oliver

************************************************************************
* Oliver Sander                ** email: sander at mi.fu-berlin.de        *
* Freie Universität Berlin     ** phone: + 49 (30) 838 75217           *
* Institut für Mathematik II   ** URL  : page.mi.fu-berlin.de/~sander  *
* Arnimallee 6                 ** -------------------------------------*
* 14195 Berlin, Germany        ** Member of MATHEON (www.matheon.de)   *
************************************************************************

On Tue, 26 Sep 2006, Bernard Haasdonk wrote:

> Hello Duners,
>
> I have different compilation modules, which are based on Dune components and 
> I get a "multiple definitions" linkage error of the static member variables 
> FakeMPIHelper::instance_ and MPIHelper::instance_
> in mpihelper.hh. Indeed these variables are defined explicitly in that header 
> file, which makes it only includable in one object file.
> I guess it is suggested to be more flexible.
>
> For my local work, putting the whole classes in an anonymous namespace works 
> fine as a workaround. However, I do not dare to implement a general solution.
>
> Bye,
>
>   Bernard
>
> ----------------------------------------------------------------------------
> Bernard Haasdonk Mathematisches Institut
> Abteilung fuer Angewandte Mathematik               Url: www.haasdonk.de
> Hermann-Herder-Strasse 10                          Tel: +49-(0)761-203-5639
> D-79104 Freiburg i. Br.                            Fax: +49-(0)761-203-5632
> ----------------------------------------------------------------------------
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://www.dune-project.org/cgi-bin/mailman/listinfo/dune
>


More information about the Dune mailing list