Error when build root from the source code

Hey guys, I built ROOT from source code about a half year ago, I’m trying to build root from source code in my new computer, but unfortunately some errors occur when doing “make”, and following are the errors:

In file included from /home/noctukkkrne/Downloads/root_src/net/rpdutils/src/rpdutils.cxx:29:
/usr/include/string.h:506:15: error: declaration of ‘size_t strlcpy(char*, const char*, size_t) noexcept’ has a different exception specifier
  506 | extern size_t strlcpy (char *__restrict __dest,
      |               ^~~~~~~
In file included from /home/noctukkkrne/Downloads/root_src/net/rpdutils/src/rpdutils.cxx:23:
/home/noctukkkrne/Downloads/root_src/core/clib/inc/strlcpy.h:26:8: note: from previous declaration ‘size_t strlcpy(char*, const char*, size_t)’
   26 | size_t strlcpy(char *dst, const char *src, size_t siz);
      |        ^~~~~~~
/usr/include/string.h:512:15: error: declaration of ‘size_t strlcat(char*, const char*, size_t) noexcept’ has a different exception specifier
  512 | extern size_t strlcat (char *__restrict __dest,
      |               ^~~~~~~
/home/noctukkkrne/Downloads/root_src/core/clib/inc/strlcpy.h:27:8: note: from previous declaration ‘size_t strlcat(char*, const char*, size_t)’
   27 | size_t strlcat(char *dst, const char *src, size_t siz);
      |        ^~~~~~~
make[2]: *** [net/rpdutils/CMakeFiles/rpdutil.dir/build.make:132: net/rpdutils/CMakeFiles/rpdutil.dir/src/rpdutils.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:37333: net/rpdutils/CMakeFiles/rpdutil.dir/all] Error 2

It seems like the declaration of some functions in ROOT have different exception specifiers. I thought that could be caused by the unsuitable version of C++, and I tried some different version of ROOT and C++, but it didn’t work either. I wonder how to fix it.

ROOT Version: 6.28.04
Platform: Arch linux
Compiler: gcc (GCC) 13.2.1 20230801; g++ (GCC) 13.2.1 20230801


Dear @NoctukkkRne ,
Thanks for reaching out. Your issue is a duplicate of Compilation error on arch using gcc 13.2.1: strlcopy has a different exception specifier · Issue #13529 · root-project/root · GitHub . Follow the github issue for updates.

Cheers,
Vincenzo

Dear @NoctukkkRne ,

The issue has been closed, the fix has been included in latest 6.28 patch release (just released today! will be available in the usual channels soon) and of course it will be available in next ROOT release 6.30

Cheers,
Vincenzo

I tried the version 6.28.06, and it works. Thank you for the efficient and speedy work!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.