compile VUSB for arduino errors

I have downloaded this old library that implements V-usb for Arduino but I get a few errors+warnings. I tried to compile the UsbKeyboard example. Could someone guide to fix them?

Arduino: 1.8.5 (Mac OS X), Board: "Arduino/Genuino Uno"

In file included from /Users/username/Documents/Arduino/libraries/UsbKeyboard/examples/UsbKeyboardDemo1/UsbKeyboardDemo1.pde:1:0:
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:55:1: warning: narrowing conversion of '161' from 'int' to 'const char' inside { } [-Wnarrowing]
 };
 ^
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:55:1: warning: narrowing conversion of '224' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:55:1: warning: narrowing conversion of '231' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:55:1: warning: narrowing conversion of '149' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:55:1: warning: narrowing conversion of '129' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:55:1: warning: narrowing conversion of '149' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:55:1: warning: narrowing conversion of '129' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:55:1: warning: narrowing conversion of '192' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h: In function 'unsigned char usbFunctionSetup(unsigned char*)':
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:195:37: error: conflicting declaration of 'unsigned char usbFunctionSetup(unsigned char*)' with 'C' linkage
 uchar usbFunctionSetup(uchar data[8]) 
                                     ^
In file included from /Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:13:0,
                 from /Users/username/Documents/Arduino/libraries/UsbKeyboard/examples/UsbKeyboardDemo1/UsbKeyboardDemo1.pde:1:
/Users/username/Documents/Arduino/libraries/UsbKeyboard/usbdrv.h:196:24: note: previous declaration with 'C++' linkage
 USB_PUBLIC usbMsgLen_t usbFunctionSetup(uchar data[8]);
                        ^
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Do you have that hardware? This doesn't run on a vanilla Arduino.

Yes I have built the HIDKeys example a few years back. I have flashed it using a USBasp programmer and now I want to experiment with this board using Arduino IDE.

I get other compiler errors if I compile the included example USBKeyboard on a current IDE.

What exactly are you trying to compile? What exact version of the IDE are you using? Are you willing to fix all the errors that occur because this code was written for an ancient version of the IDE (it will be a lot)?

pylon: I get other compiler errors if I compile the included example USBKeyboard on a current IDE.

What exactly are you trying to compile? What exact version of the IDE are you using? Are you willing to fix all the errors that occur because this code was written for an ancient version of the IDE (it will be a lot)?

I tried to compile UsbKeyboardDemo1 with IDE 1.8.5 on Mac OS X.

I used the fix here.
On Arduino IDE 1.0.6 it compiles without problems.
On Arduino IDE 1.8.5 it gave me these warnings

/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: warning: narrowing conversion of '161' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: warning: narrowing conversion of '224' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: warning: narrowing conversion of '231' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: warning: narrowing conversion of '149' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: warning: narrowing conversion of '129' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: warning: narrowing conversion of '149' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: warning: narrowing conversion of '129' from 'int' to 'const char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: warning: narrowing conversion of '192' from 'int' to 'const char' inside { } [-Wnarrowing]

I also tried on platformio and I got the same warnings but they were errors this time:

/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: error: narrowing conversion of '161' from 'int' to 'char' inside { } [-Wnarrowing]
};
^
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: error: narrowing conversion of '224' from 'int' to 'char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: error: narrowing conversion of '231' from 'int' to 'char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: error: narrowing conversion of '149' from 'int' to 'char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: error: narrowing conversion of '129' from 'int' to 'char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: error: narrowing conversion of '149' from 'int' to 'char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: error: narrowing conversion of '129' from 'int' to 'char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/UsbKeyboard.h:56:1: error: narrowing conversion of '192' from 'int' to 'char' inside { } [-Wnarrowing]
/Users/username/Documents/Arduino/libraries/UsbKeyboard/examples/UsbKeyboardDemo1/UsbKeyboardDemo1.ino: In function 'void delayMs(unsigned int)':
/Users/username/Documents/Arduino/libraries/UsbKeyboard/examples/UsbKeyboardDemo1/UsbKeyboardDemo1.ino:23:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < ms; i++) {
^
*** [.pioenvs/nanoatmega328/lib9ee/UsbKeyboard/usbdrvasm.asm.o] Error 1
*** [.pioenvs/nanoatmega328/src/UsbKeyboardDemo1.ino.cpp.o] Error 1

How coud I fix those warnings?

On IDE 1.8.7 I don’t get any warnings except that it cannot detect which libraries were included by the assembler file but you can ignore that warning.