You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The README mentions that it's possible to use the g810-led library in other projects by including the Keyboard.h file and linking the g810-led library. However, I noticed that the Keyboard.h file contains some #if defined(...) instructions which need to define either hidapi or libusb. These instructions are used to add library-specific fields to the LedKeyboard class. Without defining neither of the constants, the program allocates too little memory for LedKeyboard objects and this leads to buffer overflows.
Requiring to define one of the usb libraries is also not good, because when dynamically linking, it requires that the g810-led library installed on the system was compiled with the same usb library. I think the solution should be to hide this dependency from headers that are available externally, so that other projects linking against the g810-led library can work with whatever variant of g810-led is installed on the system.
The text was updated successfully, but these errors were encountered:
The README mentions that it's possible to use the g810-led library in other projects by including the
Keyboard.h
file and linking the g810-led library. However, I noticed that theKeyboard.h
file contains some#if defined(...)
instructions which need to define eitherhidapi
orlibusb
. These instructions are used to add library-specific fields to theLedKeyboard
class. Without defining neither of the constants, the program allocates too little memory forLedKeyboard
objects and this leads to buffer overflows.Requiring to define one of the usb libraries is also not good, because when dynamically linking, it requires that the g810-led library installed on the system was compiled with the same usb library. I think the solution should be to hide this dependency from headers that are available externally, so that other projects linking against the g810-led library can work with whatever variant of g810-led is installed on the system.
The text was updated successfully, but these errors were encountered: