Admin message

🚀 First Gmsh User Meeting, 8-9 July 2026, Liège, Belgium

Declaring hxt_omp.h as extern "C" in C++ files leads to compile errors with g++ version 15.1.0
When I try to compile Gmsh in MSys2 with the gcc-compilers version 15.1.0, I get errors about "template with C linkage" in *omp.h*. It turns out that the compiler's *omp.h* checks if it is used by a C++ compiler. If so, it defines some templates. The header *hxt_omp.h*, which includes *omp.h*, seems to be used in C and C++ files. The two C++ source files *contrib/hxt/tetBR/src/hxt_boundary_recovery.cxx* and *src/mesh/meshGRegionHxt.cpp* include *hxt_omp.h* within an `extern "C" {}` section, which cause the problems. Moving out `#include "hxt_omp.h"` from the `extern "C" {}` section and apply it upfront solves the issue and Gmsh compiles fine. ``` diff --git a/contrib/hxt/tetBR/src/hxt_boundary_recovery.cxx b/contrib/hxt/tetBR/src/hxt_boundary_recovery.cxx index a616c3f8f..95b0d9379 100644 --- a/contrib/hxt/tetBR/src/hxt_boundary_recovery.cxx +++ b/contrib/hxt/tetBR/src/hxt_boundary_recovery.cxx @@ -1,7 +1,7 @@ +#include "hxt_omp.h" extern "C" { #include "hxt_mesh.h" #include "hxt_tools.h" -#include "hxt_omp.h" #include "predicates.h" } ``` ``` diff --git a/src/mesh/meshGRegionHxt.cpp b/src/mesh/meshGRegionHxt.cpp index 75ea026bd..98c8a5464 100644 --- a/src/mesh/meshGRegionHxt.cpp +++ b/src/mesh/meshGRegionHxt.cpp @@ -24,8 +24,8 @@ #if defined(HAVE_HXT) -extern "C" { #include "hxt_omp.h" +extern "C" { #include "hxt_tetMesh.h" #include "hxt_tetDelaunay.h" } ```
issue