From cd9a18910bfcba1e047558a43ec1fc6c47f899ea Mon Sep 17 00:00:00 2001 From: Bertrand Bellenot Date: Fri, 23 Oct 2026 12:51:38 +0200 Subject: [PATCH 1/3] [win] Export missing symbols Force export of the missing std::filesystem symbols, not exposed by MSVCP140.dll Fixes https://github.com/root-project/root/issues/23664 --- core/metacling/src/CMakeLists.txt | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/core/metacling/src/CMakeLists.txt b/core/metacling/src/CMakeLists.txt index f7d91833b7e34..68952385774ee 100644 --- a/core/metacling/src/CMakeLists.txt +++ b/core/metacling/src/CMakeLists.txt @@ -140,6 +140,7 @@ if(MSVC) set(cling_exports ${cling_exports} ??_7type_info@@6B@ ?nothrow@std@@3Unothrow_t@1@B + __std_replace_copy_2 __std_reverse_trivially_swappable_1 __std_reverse_trivially_swappable_2 __std_reverse_trivially_swappable_4 @@ -151,6 +152,41 @@ if(MSVC) _Smtx_lock_shared _Smtx_unlock_shared ) + # Export the missing std::filesystem symbols (not exposed by MSVCP140.dll) + set(cling_exports ${cling_exports} + __std_fs_change_permissions + __std_fs_close_handle + __std_fs_code_page + __std_fs_convert_narrow_to_wide + __std_fs_convert_wide_to_narrow + __std_fs_convert_wide_to_narrow_replace_chars + __std_fs_copy_file + __std_fs_create_directory + __std_fs_create_directory_symbolic_link + __std_fs_create_hard_link + __std_fs_create_symbolic_link + __std_fs_directory_iterator_advance + __std_fs_directory_iterator_close + __std_fs_directory_iterator_open + __std_fs_equivalent + __std_fs_get_current_path + __std_fs_get_file_attributes_by_handle + __std_fs_get_final_path_name_by_handle + __std_fs_get_full_path_name + __std_fs_get_stats + __std_fs_get_temp_path + __std_fs_is_junction_from_reparse_data_buffer + __std_fs_open_handle + __std_fs_read_name_from_reparse_data_buffer + __std_fs_read_reparse_data_buffer + __std_fs_remove + __std_fs_rename + __std_fs_resize_file + __std_fs_set_current_path + __std_fs_set_last_write_time + __std_fs_space + __std_fs_write_reparse_data_buffer + ) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(cling_exports ${cling_exports} From 11237b57a98b7c4e6b7db95846ca3ad153f858d1 Mon Sep 17 00:00:00 2001 From: Bertrand Bellenot Date: Sat, 24 Oct 2026 10:56:05 +0200 Subject: [PATCH 2/3] [win] Export one symbol conditionally on MSVC version --- core/metacling/src/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/metacling/src/CMakeLists.txt b/core/metacling/src/CMakeLists.txt index 68952385774ee..d4c709cd0ecb4 100644 --- a/core/metacling/src/CMakeLists.txt +++ b/core/metacling/src/CMakeLists.txt @@ -140,7 +140,6 @@ if(MSVC) set(cling_exports ${cling_exports} ??_7type_info@@6B@ ?nothrow@std@@3Unothrow_t@1@B - __std_replace_copy_2 __std_reverse_trivially_swappable_1 __std_reverse_trivially_swappable_2 __std_reverse_trivially_swappable_4 @@ -152,6 +151,11 @@ if(MSVC) _Smtx_lock_shared _Smtx_unlock_shared ) + if(MSVC_VERSION GREATER_EQUAL 1941) + set(cling_exports ${cling_exports} + __std_replace_copy_2 + ) + endif() # Export the missing std::filesystem symbols (not exposed by MSVCP140.dll) set(cling_exports ${cling_exports} __std_fs_change_permissions From 774c917ed4c5caa3d4711485efff6d01b1eb895e Mon Sep 17 00:00:00 2001 From: Bertrand Bellenot Date: Sat, 24 Oct 2026 14:38:08 +0200 Subject: [PATCH 3/3] [win] Try another MSVC version --- core/metacling/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/metacling/src/CMakeLists.txt b/core/metacling/src/CMakeLists.txt index d4c709cd0ecb4..b91c02f2f7406 100644 --- a/core/metacling/src/CMakeLists.txt +++ b/core/metacling/src/CMakeLists.txt @@ -151,7 +151,7 @@ if(MSVC) _Smtx_lock_shared _Smtx_unlock_shared ) - if(MSVC_VERSION GREATER_EQUAL 1941) + if(MSVC_VERSION GREATER_EQUAL 1951) set(cling_exports ${cling_exports} __std_replace_copy_2 )