[Bug report] nrf cloud headers not working for C++

Hi,

I want to report a bug/issue with the NCS, is this the right place to do that?

We are compiling for C++, so when including headers like <net/nrf_cloud_coap.h> and <net/nrf_cloud_fota_poll.h>
there are some issues.

1. In net/nrf_cloud_fota_poll.h, the curly bracket of 
#ifdef __cplusplus
extern "C" {
#endif
is not closed in the end of the file.
2. In net/nrf_cloud_coap.h, there is an issue with having 
#ifdef __cplusplus
extern "C" {
#endif
before the #includes.
In the first case, it is possible to come around by adding a closing curling bracket after including the header.
In the second case, it is possible to come around by including these three in this exact order:
#include <zephyr/sys/cbprintf.h>
#include <zephyr/sys/cbprintf_cxx.h>
#include <net/nrf_cloud_coap.h>
Even if it's possible to come around, I wanted to report the bugs. Maybe there are some more, so it could be useful to compile for C++ in your tests perhaps.
Parents
  • Hello Nicholas,

    Thanks for taking the time for reporting this. Indeed this is an area of improvement in our test setup that we will look to address in the short term. The fix for the missing brackets is under review now and I found it in another library, so both should be fine soon.

    Regarding the libraries that you recommend to add to nrf_cloud_coap.h, seems to me that these are impacting the application more than the library, could you expand why you came up with these libraries in specific?

    Regards,

    Pascal.

Reply
  • Hello Nicholas,

    Thanks for taking the time for reporting this. Indeed this is an area of improvement in our test setup that we will look to address in the short term. The fix for the missing brackets is under review now and I found it in another library, so both should be fine soon.

    Regarding the libraries that you recommend to add to nrf_cloud_coap.h, seems to me that these are impacting the application more than the library, could you expand why you came up with these libraries in specific?

    Regards,

    Pascal.

Children
Related