I2C library not working properly(connect with pca9685)

I have a TX2 with Jetpack 4.2, and I’m trying to use the Jetsonhacks driver for the PCA9685.

I’ve installed the I2C tools with the command “sudo apt-get install libi2c-dev i2c-tools” as per their instructions, and the interface board is properly detected under i2cdetect. But when I attempt to compile their example code, I get the error:

jetson@jetson:~/JHPWMDriver/example$ make
g++ servoExample.cpp ../src/JHPWMPCA9685.cpp -I../src -o servoExample
../src/JHPWMPCA9685.cpp: In member function ‘int PCA9685::readByte(int)’:
../src/JHPWMPCA9685.cpp:86:20: error: ‘i2c_smbus_read_byte_data’ was not declared in this scope
     int toReturn = i2c_smbus_read_byte_data(kI2CFileDescriptor, readRegister);
                    ^~~~~~~~~~~~~~~~~~~~~~~~
../src/JHPWMPCA9685.cpp:86:20: note: suggested alternative: ‘i2c_smbus_ioctl_data’
     int toReturn = i2c_smbus_read_byte_data(kI2CFileDescriptor, readRegister);
                    ^~~~~~~~~~~~~~~~~~~~~~~~
                    i2c_smbus_ioctl_data
../src/JHPWMPCA9685.cpp: In member function ‘int PCA9685::writeByte(int, int)’:
../src/JHPWMPCA9685.cpp:101:20: error: ‘i2c_smbus_write_byte_data’ was not declared in this scope
     int toReturn = i2c_smbus_write_byte_data(kI2CFileDescriptor, writeRegister, writeValue);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/JHPWMPCA9685.cpp:101:20: note: suggested alternative: ‘i2c_smbus_ioctl_data’
     int toReturn = i2c_smbus_write_byte_data(kI2CFileDescriptor, writeRegister, writeValue);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
                    i2c_smbus_ioctl_data
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

Does anyone know what’s going on here? In my attempts at researching this error, I’ve found
extern “C” {
#include <i2c/smbus.h>
}
have to included in header files when use xavier. but It doesn’t work.
I’m trying to connect servo motor with PCA9685 to steering control.
I connected Pin1-Vcc, Pin6-ground, pin27-sda, pin28-scl
I’m using ubuntu 18.04 cause using jetpack 4.2
Does anyone know how to actually do when using tx2?
Thank you.

I have to add header file at /src/JHPWMPCA9685.cpp

add #include <i2c/smbus.h> to JHPWMCA9865.h