Re: CPP support

David Leach

Any consideration in upstreaming the C++ versions of the semaphores and mutexs?

-----Original Message-----
From: users@... <users@...> On Behalf Of Kim Boendergaard via
Sent: Wednesday, December 15, 2021 1:30 AM
To: Guy Morand <guy.morand@...>; Zephyr-users@...
Subject: Re: [Zephyr-users] CPP support

I think you are missing CONFIG_LIB_CPLUSPLUS=y

When it comes to threads (and semaphores, mutex etc) the Zephyr implementation is lacking a bit, but except from that it is working fine.
We have made our own C++ versions of semaphores, mutex etc based on the Zephyr kernel API.

Usage of iostream takes up a lot of flash resources

Best regards,

Kim B√łndergaard

-----Original Message-----
From: users@... <users@...> On Behalf Of Guy Morand
Sent: Tuesday, 14 December 2021 17.22
To: Zephyr-users@...
Subject: [Zephyr-users] CPP support

EXTERNAL - Use caution when opening link(s) or attachment(s) ________________________________

Hi Zephyr users!

I'm new to Zephyr and was asked to write a small "study" project in c++.
I didn't find much in the documentation about c++, except one sample and the following page:!!KHGsRxShrw!q__J4PjhnarC-Jb1FvV4Wwd6ge_OL5p7ZPC38_w0Agi5c7hMfT_zp-SLVDmfr3bDSstITFXG%24&amp;;sdata=KxWvulJLRIlpVEki%2F9dDofmAa0l1LaVlbeKUyFMVCkk%3D&amp;reserved=0

I'm using the Zephyr SDK 0.13.2 and I started with:

#include <memory>

void main(void) {
std::unique_ptr<int> intValue = std::make_unique<int>(1234);

while(1) {

My prj.conf contains:


Unfortunately, it doesn't build although I can find the <memory> header file in the SDK:

main.cpp:6:10: fatal error: memory: No such file or directory
6 | #include <memory>
| ^~~~~~~~

* Am I missing something?
* Is the current cpp status is very limited and should avoid standard
library? (what would makes sense :D)

Kind regards,


[The information contained in this email (including any attachments) is confidential and is intended solely for the use of the named addressee. Any unauthorized use, disclosure, reproduction, copying, distribution, or other form of unauthorized dissemination of the contents is expressly prohibited. If you have received this communication in error, please notify the sender immediately by email and delete the original message. Opinions, conclusions and other information in this message represent the opinion of the sender and do not necessarily represent or reflect the views and opinions of Esco Lifesciences Group companies.]

Join to automatically receive all group messages.