sudo apt-get install libudev-dev libsystemd-dev
cc -g -O0 --std=gnu99 --pedantic `pkg-config --cflags libusb-1.0` stlink.o stlinkv2.o espstlink.o main.o byte_utils.o ihex.o srec.o stm8.o `pkg-config --libs libusb-1.0` -o stm8flash
Note, in above,
pkg-config --cflags libusb-1.0
produces
-I/usr/include/libusb-1.0
The following is the command that made stm8flash to work:
sudo apt-get install libusb-1.0