std::mutex error when compiling for RPi Pico (CMake)

I have been looking at this problem for a few days now and cannot seem to find the answer in any online forums/ document.
This is what I’m doing: I have a RPi 3B connected via USB to a RPi Pico (actually it’s not connected yet but that’s irrelevant, I’m just building the binaries for now). I SSH with my computer to the 3B, and have all of the project stored in that device.
I’m using cmake to compile and run everything. After typing cmake .. , I then type sudo make VERBOSE=1

Overview of file structure:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>PovGlobe
|--depes
|--build
|--cpp_src
|--...
</code>
<code>PovGlobe |--depes |--build |--cpp_src |--... </code>
PovGlobe
|--depes
|--build
|--cpp_src
|--...

Here is a snapshot of the CMakeLists.txt in the PovGlobe (parent) directory:
CMakeLists.text:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>cmake_minimum_required(VERSION 3.10)
set(PICO_SDK_FETCH_FROM_GIT on)
set(PICO_SDK_PATH "/home/nicoc/PovGlobe/depes/pico-sdk")
include(/home/nicoc/PovGlobe/depes/pico-sdk/pico_sdk_init.cmake)
project(PovGlobe)
set(EXT_DIR ./ext)
set(PICO_SDK_FETCH_FROM_GIT on)
set(PYTHON_LIBRARIES "/usr/lib/aarch64-linux-gnu/libpython3.11.so")
set(PYTHON_INCLUDE_DIRS "/usr/include/python3.11")
pico_sdk_init()
set(CORE_LIB_NAME ${CMAKE_PROJECT_NAME}_core_lib)
set(HW_LIB_EXT_NAME ${CMAKE_PROJECT_NAME}_hw_lib_ext)
set(SIM_LIB_EXT_NAME ${CMAKE_PROJECT_NAME}_sim_lib_ext)
set(APPS_LIB_NAME ${CMAKE_PROJECT_NAME}_apps_lib)
set(PY_WRAPPER_LIB_NAME Py${CMAKE_PROJECT_NAME})
set(EXEC_MAIN_NAME ${CMAKE_PROJECT_NAME})
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
...
</code>
<code>cmake_minimum_required(VERSION 3.10) set(PICO_SDK_FETCH_FROM_GIT on) set(PICO_SDK_PATH "/home/nicoc/PovGlobe/depes/pico-sdk") include(/home/nicoc/PovGlobe/depes/pico-sdk/pico_sdk_init.cmake) project(PovGlobe) set(EXT_DIR ./ext) set(PICO_SDK_FETCH_FROM_GIT on) set(PYTHON_LIBRARIES "/usr/lib/aarch64-linux-gnu/libpython3.11.so") set(PYTHON_INCLUDE_DIRS "/usr/include/python3.11") pico_sdk_init() set(CORE_LIB_NAME ${CMAKE_PROJECT_NAME}_core_lib) set(HW_LIB_EXT_NAME ${CMAKE_PROJECT_NAME}_hw_lib_ext) set(SIM_LIB_EXT_NAME ${CMAKE_PROJECT_NAME}_sim_lib_ext) set(APPS_LIB_NAME ${CMAKE_PROJECT_NAME}_apps_lib) set(PY_WRAPPER_LIB_NAME Py${CMAKE_PROJECT_NAME}) set(EXEC_MAIN_NAME ${CMAKE_PROJECT_NAME}) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) ... </code>
cmake_minimum_required(VERSION 3.10)

set(PICO_SDK_FETCH_FROM_GIT on)

set(PICO_SDK_PATH "/home/nicoc/PovGlobe/depes/pico-sdk")
include(/home/nicoc/PovGlobe/depes/pico-sdk/pico_sdk_init.cmake)

project(PovGlobe)

set(EXT_DIR ./ext)
set(PICO_SDK_FETCH_FROM_GIT on)
set(PYTHON_LIBRARIES "/usr/lib/aarch64-linux-gnu/libpython3.11.so")
set(PYTHON_INCLUDE_DIRS "/usr/include/python3.11")


pico_sdk_init()

set(CORE_LIB_NAME ${CMAKE_PROJECT_NAME}_core_lib)
set(HW_LIB_EXT_NAME ${CMAKE_PROJECT_NAME}_hw_lib_ext)
set(SIM_LIB_EXT_NAME ${CMAKE_PROJECT_NAME}_sim_lib_ext)
set(APPS_LIB_NAME ${CMAKE_PROJECT_NAME}_apps_lib)

set(PY_WRAPPER_LIB_NAME Py${CMAKE_PROJECT_NAME})

set(EXEC_MAIN_NAME ${CMAKE_PROJECT_NAME})

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE Release)
endif()

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
...

(I excluded extra lines i think were not relevant)

After running the sudo make VERBOSE=1, the compilator starts but ends with this error (mentions the error two times actually as I use mutex two times):

Console out:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>[ 50%] Building CXX object cpp_src/PovGlobe/sim/CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj
cd /home/nicoc/PovGlobe/build/cpp_src/PovGlobe/sim && /usr/bin/arm-none-eabi-g++ -DSIM_AVAILABLE -Wall -Wextra -O3 -std=gnu++14 -MD -MT cpp_src/PovGlobe/sim/CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj -MF CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj.d -o CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj -c /home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/renderer_sim.cpp
(skipping warnings)
/home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:9:1: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
8 | #include "helper.hpp"
+++ |+#include <mutex>
9 | #include <mutex>
/home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:69:10: error: 'mutex' in namespace 'std' does not name a type
69 | std::mutex m_double_buffer_mutex;
| ^~~~~
/home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:69:5: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
69 | std::mutex m_double_buffer_mutex;
| ^~~
</code>
<code>[ 50%] Building CXX object cpp_src/PovGlobe/sim/CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj cd /home/nicoc/PovGlobe/build/cpp_src/PovGlobe/sim && /usr/bin/arm-none-eabi-g++ -DSIM_AVAILABLE -Wall -Wextra -O3 -std=gnu++14 -MD -MT cpp_src/PovGlobe/sim/CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj -MF CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj.d -o CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj -c /home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/renderer_sim.cpp (skipping warnings) /home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:9:1: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'? 8 | #include "helper.hpp" +++ |+#include <mutex> 9 | #include <mutex> /home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:69:10: error: 'mutex' in namespace 'std' does not name a type 69 | std::mutex m_double_buffer_mutex; | ^~~~~ /home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:69:5: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'? 69 | std::mutex m_double_buffer_mutex; | ^~~ </code>
[ 50%] Building CXX object cpp_src/PovGlobe/sim/CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj
cd /home/nicoc/PovGlobe/build/cpp_src/PovGlobe/sim && /usr/bin/arm-none-eabi-g++ -DSIM_AVAILABLE  -Wall -Wextra -O3 -std=gnu++14 -MD -MT cpp_src/PovGlobe/sim/CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj -MF CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj.d -o CMakeFiles/PovGlobe_sim_lib_ext.dir/renderer_sim.cpp.obj -c /home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/renderer_sim.cpp
(skipping warnings)
/home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:9:1: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
    8 | #include "helper.hpp"
  +++ |+#include <mutex>
    9 | #include <mutex>
/home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:69:10: error: 'mutex' in namespace 'std' does not name a type
   69 |     std::mutex m_double_buffer_mutex;
      |          ^~~~~
/home/nicoc/PovGlobe/cpp_src/PovGlobe/sim/../core/globe.hpp:69:5: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
   69 |     std::mutex m_double_buffer_mutex;
      |     ^~~

You can even see during the traceback that mutex is already included (and even then it suggests including it again)
There are two hpp files that use sdt::mutex and both of them throw the error in almost the extact same way.
Is there a problem with my compiler? Should i add another library to the CMake file?

Thanks a lot everyone.

I investigated some time but I was not able to find any information regarding the subject.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật