Forum > Packages and Libraries

Import libusb0_x86.dll or any other .dll in lazarus


I've tried to import external dll to lazarus with {&LINKLIB libusb0_x86} but on compile says "not found". Im beginner in Lazarus but senior in VB.NET and i need only short explanation "how to import dll" in lazarus. In Lazarus wiki/help DYNAMIC LIBRARY i've found an owfull example which dont explains NOTHING,  so if there any REAL PROGRAMMER can explain this.

Best Regards


Please read the topic here:
or the last post on the same topic (,7747.msg44837.html#msg44837 )


{$LINKLIB } requires a library to link against. That is typically a file with extension .a or .lib. Hence the not found. Specify lib\gcc\libusb.a in the libusb-win32 directory.

libusb0_x86 is a dll which should be renamed to libusb0.dll when put in the windows\system32 directory. Please read libusb-win32-bin-README.txt in the bin directory. explains other ways of using external libraries.

Last but not least, a libusb unit has been created by Marko Medic :,11435.0.html. Here you'll find a link to LIBUSB that contains the unit and a test program. It is written for linux but it is a good start for windows.

A delphi port can be found here:
You'll need to add {$mode delphi} to the unit to get it compiled. It uses directly the dll, without a {$linklib }.

libusb already has Pascal translated headers:,13000.msg67843.html#msg67843


[0] Message Index

Go to full version