ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.73k stars 402 forks source link

i can`t use x86_64-w64-mingw32-g++ build the project in the linux #920

Open li-yun-xian opened 3 weeks ago

li-yun-xian commented 3 weeks ago

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

ArthurSonzogni commented 3 weeks ago

Hello, Could you please provide the steps to reproduce?

li-yun-xian commented 3 weeks ago

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

cole-io commented 3 weeks ago

Are you compiling with --std=c++23?