[Gmsh] Multiple-definition error with the gmsh.h_cwrap header for the C++ API

Julien Hess julien.hess.ch at gmail.com
Tue Mar 12 11:07:04 CET 2019


Dear gmsh users,

I would like to use the C++ API of the Linux SDK (compiled with GCC 4) 
in a program that I must compile with gcc-5.5.0.

Specifying "-D_GLIBCXX_USE_CXX11_ABI=0" is not an option, as the program 
also uses several other libraries compiled with GCC 5 or higher.

According to the `README.txt' in the SDK, another approach is to rename 
`gmsh.h_cwrap' as `gmsh.h' in order to redefine the C++ API in terms of 
the C API. If I do just that, the linker complains about several 
"multiple-definition" errors, which come from the fact that the 
functions in the `gmsh.h_cwrap' header are not /inline/d.

My temporary solution was to manually inline the 4 utility functions and 
to "#define GMSH_API inline" for the rest of the API functions. This 
does the trick, but I am pretty sure the gmsh developers though of a 
cleaner solution. What is the proper way to use this `gmsh.h_cwrap' header?

Thank you in advance for any advice, and many thanks and congratulations 
to the gmsh team for the amazing work!

Cheers,

Julien

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190312/3d30bd79/attachment.html>


More information about the gmsh mailing list