error:/Mesh/MMGMesh.cpp.o: multiple definition of `MMG3D_lenedgCoor'

Dear sir:
I tried to incorporate the MMG5_pMesh and MMG5_pSol in my class as follows:

#ifndef MMGMESH_H
#define MMGMESH_H
#include “Include.h”
#include “mmg/mmg3d/libmmg3d.h”
class MMGMesh
{
public:
MMGMesh (Teuchos::RCP<Epetra_MpiComm>, int , int );

~MMGMesh(){};

protected:

MMG5_pMesh mmgMesh;

MMG5_pSol mmgSol;

Teuchos::RCP<Epetra_MpiComm> Comm;
};
#endif

but when i compile it. it gives me the error about:
/usr/lib64/gcc/x86_64-suse-linux/7/…/…/…/…/x86_64-suse-linux/bin/ld: CMakeFiles/main.dir/Mesh/MMGMesh.cpp.o:(.bss+0x0): multiple definition of `MMG3D_lenedgCoor’; CMakeFiles/main.dir/main.cpp.o:(.bss+0x0): first defined here.

How to resolve this problem.

Hi,

I think that I solve this issue (it was due to a prototype error foe the MMG3D_lenedgCoor function).
I have pushed the correction in the master branch of the project (commit 32770b48e). Please, let me know if it works for you.

Regards,
Algiane

I include “mmgtypes.h” in the header file , and mmg3d.h in the cpp file.
It can be compiled with no error.
Does this work?

Hi,

I am not sure to understand why it was building without this inclusions for me but I am glad that you solve your issue.

Regards