在lazarus编译YT88加密锁的应用时遇到在LIBUSB_DLL_NAME设置为libusb-1.0.so.0.2.0后提示:
uint8_t = __int8; uint16_t = __int16; uint32_t = __int32; const LIBUSB_DLL_NAME = 'libusb-1.0.so.0.2.0'; //defined for windows stdcall ZERO_SIZED_ARRAY = 0; (* [0] - non-standard, but usually working code *) LIBUSB_API_VERSION = $01000106; (*The following is kept for compatibility, but will be deprecated in the future*) LIBUSBX_API_VERSION = LIBUSB_API_VERSION; const (* standard USB stuff *)
编译时提示:
Warning: linker: /usr/bin/ld.bfd: 找不到 -lusb-1.0

解决方法:
1、在/lib/x86_64-linux-gnu目录先建软连接:
sudo ln -s libusb-1.0.so.0.2.0 libusb-1.0.so
2、将LIBUSB_DLL_NAME设置为libusb-1.0.so
uint8_t = __int8; uint16_t = __int16; uint32_t = __int32; const LIBUSB_DLL_NAME = 'libusb-1.0.so'; //defined for windows stdcall ZERO_SIZED_ARRAY = 0; (* [0] - non-standard, but usually working code *) LIBUSB_API_VERSION = $01000106; (*The following is kept for compatibility, but will be deprecated in the future*) LIBUSBX_API_VERSION = LIBUSB_API_VERSION; const (* standard USB stuff *)
重新编译就可以:


浙公网安备 33010602011771号