秋·风

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::
在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

QQ_1764715999391

解决方法:
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 *)

重新编译就可以:

QQ_1764716403362

posted on 2025-12-03 07:00  秋·风  阅读(0)  评论(0)    收藏  举报