From 281984b3e3c0ca7ad92055852534577da34777e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=2E=20Armando=20Sol=C3=A9?= Date: Tue, 6 Dec 2022 02:19:53 +0100 Subject: H5E_ERR_CLS_g symbol missing when compiling C++ plugins (#2269) C++ HDF5 filter plugin SZ3 fails to build under windows with failure at linking time unless that extern "C" block is added. --- src/H5Epublic.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 5f4e325..c01fa2b 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -59,8 +59,15 @@ typedef struct H5E_error2_t { #endif /* H5private_H */ /* HDF5 error class */ +/* Extern "C" block needed to compile C++ filter plugins with some compilers */ +#ifdef __cplusplus +extern "C" { +#endif #define H5E_ERR_CLS (H5OPEN H5E_ERR_CLS_g) H5_DLLVAR hid_t H5E_ERR_CLS_g; +#ifdef __cplusplus +} +#endif /* Include the automatically generated public header information */ /* (This includes the list of major and minor error codes for the library) */ -- cgit v0.12