Apple Event: May 7th at 7 am PT

C++ std::chrono error: no matching function for call to 'construct_at'

Hi everybody!


So I'm developing a pc daemon in C++ for rmultiplatform purposes and I came to a problem considering the mac OS platform. The source perfectly compiles and bulids on linux and windows machines, but the process fails on mac. I'm using a model mac mini M1 (16GB). The log is provided below!



The main problem as far as I could get goes back to the std::chrono library. Actually the error is throw 4 times at 4 different parts of the code, totally independent on user code and traces back to the chrono library (see log), where apparently after a few stack calls it ends up at the .../__memory/allocator_traits.h file (line 304:9), where the error "no matching function for call to 'construct_at'" is thrown.

Did anyone ever bumped into something similar or have experience working with these libraries on mac OS?

I would appretiate any kind of help!

Thank y'all!

Mac mini (M1, 2020)

Posted on Apr 24, 2024 7:37 AM

Reply
1 reply

Apr 24, 2024 7:57 AM in response to Embedpro-LTD

Can you post some sample code that reproduces the problem?


C++ is relatively rare in the Apple developer community. Apple often doesn't fully support the real bleeding edge parts of the C++ standard library.


I tried the sample code from here, and it worked fine. The only trick was to make sure to add the C++20 option to compile it - clang++ -std=c++20 -o demo demo.cpp

C++ std::chrono error: no matching function for call to 'construct_at'

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.