I am trying to use the C library from jgraff (https://github.com/jgarff/rpi_ws281x) in a C++ project. When using the library compiled examples the string works perfectly but within my C++ project the code doesn't compile.
First I was running the the same problem as described here: Initializing typedef struct from C library properly in C++
I am still on my way to learn C++ but this struct is beyond my understanding and therefore I just copied the code over and get now the following errors.
error : braces around scalar initializer for type ‘int’
Then I stripped the initialization of the struct to the following:
ws2811_t ledstring =
{
nullptr,
TARGET_FREQ,
DMA,
GPIO_PIN, 0, LED_COUNT, 255
};
And now I am getting the following error:
error: invalid conversion from ‘int’ to ‘const rpi_hw_t*’
Please can anybody advice what's wrong?