How do I use CADMesh in parallel geometry

Hi Geant4ers:
I have recently been testing my radioactive seed , using DICOM example modeling. In this test, I intended to use CADMesh header file to import STL file of CAD output, but after including this header file, the program reported an error during compilation. I would like to ask whether I missed something or the parallel geometry cannot be built with CADMesh header file.
Thank you for your answers. Your suggestions will be of great help to me. I wish you all a happy life.

The reason for this problem is that I also included CADMesh header files in other files, which caused the error of repeated definition. As long as the parallel geometry is the only one containing CADMesh header file, it can work normally.

That sounds like cadmesh.h includes function definitions (i.e., inlines) without using the inline keyword consistently. With some compilers, function definitions are not inlined without the explicit keyword, and you end up with “multiple definitions” from each compilation unit (.o file).

What you’ve done is correct. In general, you should only ever include a .h file in whichever .cc file or files where it is actually used.

Thank you for your timely reply. I will try your opinions.