Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [OMPI users] Open MPI error to define MPI_Datatype in header file
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2011-10-10 09:58:20

You'll need to be a bit more specific. What describe should work fine.

extern MPI_Datatype mydtype;
#inlclude "foo.h"
MPI_Datatype mydtype;
#include "foo.h"
void bogus(void) {
  MPI_Datatype foo = mydtype;

On Oct 9, 2011, at 4:10 PM, Jack Bryan wrote:

> Hi,
> I need to define a (Open MPI) MPI_Datatype in a header file so that all other files that include it can find it.
> I also try to use extern to do decleration in .h file and then define them in .cpp file.
> But, I always get error:
> undefined reference
> It is not allowed in Open MPI ?
> Why ?
> Any help is really appreciated.
> Thanks
> _______________________________________________
> users mailing list
> users_at_[hidden]

Jeff Squyres
For corporate legal information go to: