How to compile this project correctly
Step 1 git clone https://gitlab.freedesktop.org/spice/usbredir.git
Step 2
cd usbredir
meson build
The Meson build system
Version: 0.55.1
Source dir: /home/liyang21/usbredir
Build dir: /home/liyang21/usbredir/build
Build type: native build
Project name: usbredir
Project version: 0.13.0
C compiler for the host machine: cc (gcc 4.8.5 "cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)")
C linker for the host machine: cc ld.bfd 2.27-43
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments --param=ssp-buffer-size=4: YES
Compiler for C supports arguments -D_FORTIFY_SOURCE=2: YES
Compiler for C supports arguments -fstack-protector: YES
Compiler for C supports arguments -Werror: YES
Checking if "visibility check" compiles: YES
Has header "inttypes.h" : YES
Has header "stdint.h" : YES
Has header "stdlib.h" : YES
Has header "strings.h" : YES
Has header "string.h" : YES
Has header "sys/stat.h" : YES
Has header "sys/types.h" : YES
Has header "unistd.h" : YES
Configuring config.h using configuration
Compiler for C supports link arguments -Wl,--version-script=/home/liyang21/usbredir/usbredirparser/usbredirparser.map: YES
Compiler for C supports link arguments -Wl,--no-undefined: YES
Compiler for C supports link arguments -Wl,-dead_strip: NO
Compiler for C supports link arguments -Wl,--version-script=/home/liyang21/usbredir/usbredirhost/usbredirhost.map: YES
Compiler for C supports link arguments -Wl,--no-undefined: YES (cached)
Compiler for C supports link arguments -Wl,-dead_strip: NO (cached)
Found pkg-config: /bin/pkg-config (0.27.1)
Run-time dependency libusb-1.0 found: YES 1.0.21
Run-time dependency glib-2.0 found: YES 2.56.1
Run-time dependency gio-unix-2.0 found: YES 2.56.1
Dependency glib-2.0 found: YES 2.56.1 (cached)
Build targets in project: 6
usbredir 0.13.0
prefix: /usr/local
libusbredirparser.so version: 1.2.1
libusbredirhost.so version: 1.0.3
Found ninja-1.10.2 at /bin/ninja
Step 3
cd build
ninja
[1/15] Compiling C object tests/test-filter.p/filter.c.o
FAILED: tests/test-filter.p/filter.c.o
cc -Itests/test-filter.p -Itests -I../tests -Iusbredirparser -I../usbredirparser -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fstack-protector -Werror -MD -MQ tests/test-filter.p/filter.c.o -MF tests/test-filter.p/filter.c.o.d -o tests/test-filter.p/filter.c.o -c ../tests/filter.c
../tests/filter.c: In function ‘add_tests’:
../tests/filter.c:234:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < count; i++) {
^
../tests/filter.c:234:5: note: use option -std=c99 or -std=gnu99 to compile your code
[4/15] Compiling C object tools/usbredirect.p/usbredirect.c.o
FAILED: tools/usbredirect.p/usbredirect.c.o
cc -Itools/usbredirect.p -Itools -I../tools -Iusbredirhost -I../usbredirhost -I. -I.. -Iusbredirparser -I../usbredirparser -I/usr/include/libusb-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0/ -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fstack-protector -Werror -pthread -Wno-deprecated-declarations -MD -MQ tools/usbredirect.p/usbredirect.c.o -MF tools/usbredirect.p/usbredirect.c.o.d -o tools/usbredirect.p/usbredirect.c.o -c ../tools/usbredirect.c
../tools/usbredirect.c: In function ‘main’:
../tools/usbredirect.c:647:9: error: implicit declaration of function ‘libusb_set_option’ [-Werror=implicit-function-declaration]
int ret = libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_NONE);
^
../tools/usbredirect.c:647:43: error: ‘LIBUSB_OPTION_LOG_LEVEL’ undeclared (first use in this function)
int ret = libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_NONE);
^
../tools/usbredirect.c:647:43: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
[7/15] Compiling C object usbredirhost/libusbredirhost.so.1.0.3.p/usbredirhost.c.o
ninja: build stopped: subcommand failed.
how to solve this error?