From c3bcac7085a9210a57c49b7010139323b8de8cb9 Mon Sep 17 00:00:00 2001 From: nakmak98 Date: Sun, 9 Nov 2025 18:01:44 +0300 Subject: [PATCH] Fixed std::filesystem library linking for gcc>=9 libstdc++fs may not be present in the system, as std::filesystem is included in libstdc++ starting from gcc9, so a conditional statement has been added to CMakeLists.txt to handle linking depending on the compiler version. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90ee16c..9a351dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") include_directories(SYSTEM /usr/local/include) elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") - link_libraries(stdc++fs) + link_libraries( "$<$,$,9.0>>:-lstdc++fs>" ) elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows") add_compile_definitions(NOMINMAX WIN32_LEAN_AND_MEAN) else()