Open li-yun-xian opened 3 weeks ago
Hello, Could you please provide the steps to reproduce?
i create a toolchain.cmake file for cmake to build it
toolchaim.cmake 👇 ` set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
`
Then enter the following two commands cmake -S .. -B build -DCMAKE_TOOLCHAIN_FILE=./toolchain.cmake cmake --build build --target all
if i include mutex in other program and use mingw compile it ,will occur the same error,linux mingw maybe not support mutex
Are you compiling with --std=c++23
?
main.cpp: In function ‘int main(int, char**)’: main.cpp:5:10: error: ‘mutex’ is not a member of ‘std’ 5 | std::mutex s; | ^~~~~ main.cpp:2:1: note: ‘std::mutex’ is defined in header ‘’; did you forget to ‘#include ’?
1 | #include
+++ |+#include