Multiple Definition errors

Dear all,

when trying to compile a case with more than one .cpp file, I got multiple definition errors of type


liggghtsCouplingWrapper.cpp:(.text+0x5c0): multiple definition of `plb::computeCopyReducedBulk(plb::Box3D)'
onetoone.o:onetoone.cpp:(.text+0xa00): first defined here

for the functions


plb::computeCopyReducedBulk(plb::Box3D)

in twoPhaseModel3D.h and


plb::stringToTwoPhaseModel(std::string) 
plb::computeCopyEdges(plb::Box3D, std::vector<plb::Box3D, std::allocator<plb::Box3D> >&)
plb::computeCopyCorners(plb::Box3D, std::vector<plb::Box3D, std::allocator<plb::Box3D> >&)

in multiGridGenerator3D.hh

Adding the

[code=“cpp”]
inline


keyword to the implementations of the four functions resovles the issue.

best regards
Philippe

Dear developers,

this bug is still present in the newest Palabos release. Please consider fixing this in the next revision/release.

best
Philippe

Thanks a lot for reporting this issue, Philippe!

We added the inline keyword as you suggested, and will put this online with the next release.

Regards,
Jonas

Hello Jonas, dear all,

a new issue of this type has come up in version 1.5r1 in the file multiPhysics/twoPhaseModel3D.h:

[code=“cpp”]
TwoPhaseModel stringToTwoPhaseModel(std::string modelName)



needs to be declared inline to avoid any multiple definition errors. Please correct this in the next release.

thanks
Philippe

Hello Philippe,

I have tried with those changes you specified here. But still it shows multiple definition errors. Is it works fine for you ?

Regards,
LIsty

Hi Listy,

for me everything worked - but I can’t tell whether there are other issues like this hidden in other parts of the code. The conditional compilation via scons might hide this as I only use a small subset of the features of Palabos.