On Dec 31, 2007, at 7:12 PM, Adam C Powell IV wrote:

I'm trying to build the Salomé engineering simulation tool, and am
having trouble compiling with OpenMPI. The full text of the error is at http://lyre.mit.edu/~powell/salome-error . The crux of the problem can
be reproduced by trying to compile a C++ file with:

extern "C"
{
#include "mpi.h"
}

At the end of mpi.h, the C++ headers get loaded while in extern C mode,
and the result is a vast list of errors.

Yes, it will. Similar to other external packages (like system headers), you absolutely should not include mpi.h from an extern "C" block. It will fail, as you've noted. The proper solution is to not be in an extern "C" block when including mpi.h.

Brian


--
  Brian Barrett
  Open MPI developer
  http://www.open-mpi.org/



Reply via email to