CPP support


Guy Morand
 

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:
https://docs.zephyrproject.org/latest/reference/kernel/other/cxx_support.html


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:

```
CONFIG_CPLUSPLUS=y
CONFIG_STD_CPP20=y
```

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,

Guy

Join users@lists.zephyrproject.org to automatically receive all group messages.