Re: Checking compiler support for userspace C, C++ libs (ZeroMQ)

Stanislav Pobořil

Hi Ivan,

I have successfully tried Zephyr with C++ library (eRPC) some time ago.
The version of Zephyr was based on master branch as of March 19th.


    I haven't used zephyr-sdk, I used arm-gcc toolchain instead - standard C++ headers in zephyr-sdk were not complete and build failed in zephyr-sdk.
    I got some compilation warnings as the build system tried to put C only compiler flags to C++ sources. This could be ignored.
    I had the following in project configuration:
        CONFIG_CPLUSPLUS=n     (the demo application and Zerphyr were compiled as C, only eRPC C++ files were compiled as C++)

So your desired ZeroMQ library can have problems in zephyr-sdk, but could be probably build with third party toolchains specific to each architecture.
You may need to create definitions of some C++ operators like operator new, delete if the library does not define it. eRPC library defines it like this:
I am not sure about the version of zephyr-sdk I have used. Probably 0.9.4 or 0.9.5. The situation in the actual Zephyr and zephyr-sdk versions may be different now. Search for LIB_CPLUSPLUS in the Zephyr source, this for example includes the C++ operator definitions into a build.

It is also worth noting that eRPC is created with embedded C interoperability in mind. If your ZeroMQ library for example uses C++ exceptions, you would have to work around it somehow.

Best regards,

Join to automatically receive all group messages.