Facing issues running shell with C++


Rodrigo Peixoto <rodrigopex@...>
 

Hey guys,
I am facing issues when trying to use Shell and C++ together. It seems to be trying to see C structs as C++, but as I could notice the extern "C" is present at the shell.h. 

The issue log is:

In file included from ../src/main.cpp:21:0:
.../zephyr/include/shell/shell.h:172:41: error: uninitialized const ‘shell_sub_lora’ [-fpermissive]
  static const struct shell_static_entry shell_##name[]; \
                                         ^
../src/main.cpp:50:1: note: in expansion of macro ‘SHELL_CREATE_STATIC_SUBCMD_SET’
 SHELL_CREATE_STATIC_SUBCMD_SET(sub_lora){
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../zephyr/include/shell/shell.h:108:8: note: ‘const struct shell_static_entry’ has no user-provided default constructor
 struct shell_static_entry {
        ^~~~~~~~~~~~~~~~~~
.../zephyr/include/shell/shell.h:109:14: note: and the implicitly-defined constructor doesnot initialize ‘const char* shell_static_entry::syntax’
  const char *syntax;   /*!< Command syntax strings. */

Any idea?

Thank you.
Best regards,
Rodrigo Peixoto
Co-founder and Technical advisor

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex


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