jgarff / rpi_ws281x

Userspace Raspberry Pi PWM library for WS281X LEDs
BSD 2-Clause "Simplified" License
1.76k stars 619 forks source link

Working with cpp #429

Closed gbkwiatt closed 3 years ago

gbkwiatt commented 3 years ago

Anyone managed to get it to work with Cpp ? Seems that's the only working library for RPI, works fine with python but I am struggling to compile it under cpp.

./rpi_ws281x/main.c:95:1: error: designator order for field ‘ws2811_channel_t::invert’ does not match declaration order in ‘ws2811_channel_t’
 };
 ^
./rpi_ws281x/main.c:95:1: error: designator order for field ‘ws2811_channel_t::invert’ does not match declaration order in ‘ws2811_channel_t’
./rpi_ws281x/main.c: In function ‘int main(int, char**)’:
./rpi_ws281x/main.c:403:17: warning: invalid conversion from ‘void*’ to ‘ws2811_led_t*’ {aka ‘unsigned int*’} [-fpermissive]
  matrix = malloc(sizeof(ws2811_led_t) * width * height);
           ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./rpi_ws281x/pcm.c:106:1: error: designator order for field ‘pcm_pin_tables_t::count’ does not match declaration order in ‘const pcm_pin_tables_t’
 };
 ^
./rpi_ws281x/pcm.c:106:1: error: designator order for field ‘pcm_pin_tables_t::count’ does not match declaration order in ‘const pcm_pin_tables_t’
./rpi_ws281x/pcm.c:106:1: error: designator order for field ‘pcm_pin_tables_t::count’ does not match declaration order in ‘const pcm_pin_tables_t’
./rpi_ws281x/pcm.c:106:1: error: designator order for field ‘pcm_pin_tables_t::count’ does not match declaration order in ‘const pcm_pin_tables_t’
./rpi_ws281x/pwm.c:86:1: error: designator order for field ‘pwm_pin_tables_t::count’ does not match declaration order in ‘const pwm_pin_tables_t’
 };
 ^
./rpi_ws281x/pwm.c:86:1: error: designator order for field ‘pwm_pin_tables_t::count’ does not match declaration order in ‘const pwm_pin_tables_t’
./rpi_ws281x/rpihw.c:426:1: error: designator order for field ‘rpi_hw_t::type’ does not match declaration order in ‘const rpi_hw_t’
 };
 ^
./rpi_ws281x/rpihw.c:426:1: error: designator order for field ‘rpi_hw_t::type’ does not match declaration order in ‘const rpi_hw_t’