Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4844

SDK • Re: Trouble printing time_us_64() [SOLVED]

$
0
0

Code:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++17")
You shouldn't specify the -std flag manually. Instead, use target_compile_features(tgt PUBLIC cxx_std_17) if you want to enable C++17 for a specific target, or use set(CMAKE_CXX_STANDARD 17) at the beginning of your CMakeLists.txt if you want to enable C++17 globally.
but the cross-compiler said it did not have c++17 library, same for c++1; at the point it have gave up messing with version flags.
Which compiler are you using? What's the error you get when trying to use std::clamp? Did you include <algorithm>?

If std::clamp is really not supported by your compiler, that would mean you're using an ancient version of GCC (GCC 6 or older), and I would strongly encourage you to upgrade to a newer version. GCC's warnings have improved dramatically over the past couple of releases. You can find GCC 14 cross-compilers for the Pico here: https://github.com/tttapa/docker-arm-cr ... e#download

Statistics: Posted by tttapa — Thu Jan 02, 2025 5:36 pm



Viewing all articles
Browse latest Browse all 4844

Trending Articles