[fpc-pascal] USB Human Interface Devices

James Richters james at productionautomation.net
Tue Aug 6 19:15:37 CEST 2019


I’m trying to avoid using Lazarus because the last few times I tried to compile the rest of my project with it, I had all kinds of issues.  I can’t remember what all the problems were but it was significant enough for me to stick with the FPC blue screen text mode IDE, and that has been working fine.  I’m not sure if it’s because I have a lot of $Mode TP units mixed with FPC units, or if it’s that some of the Lazarus procedures and functions have the same name as other procedures and functions but don’t work the same way… I would have to just try it again to see what was up.    I may make another try with Lazarus, but I’m hoping to find a solution that works with just FPC, as I know for a fact the rest of my project has no problems with that.  

 

I tried just replacing libusb-1.0.dll with the one from libusb-1.0.22\MinGW32\dll from https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z as suggested, but now I get this:

 

I:\Programming\FPC\3.0.4\bin\i386-win32\fpc.exe -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Filib\i386-win32\ -Fu.. -Fu. -FUlib\i386-win32\ -FE. -otest1library.exe test1library.pas

 

Hint: (11030) Start of reading config file I:\Programming\FPC\3.0.4\bin\i386-win32\fpc.cfg

Hint: (11031) End of reading config file I:\Programming\FPC\3.0.4\bin\i386-win32\fpc.cfg

Free Pascal Compiler version 3.0.4 [2017/10/06] for i386

Copyright (c) 1993-2017 by Florian Klaempfl and others

(1002) Target OS: Win32 for i386

(3104) Compiling test1library.pas

(3104) Compiling I:\Programming\pas-libusb_test_dll\src\libusb.pas

I:\Programming\pas-libusb_test_dll\src\libusb.pas(1315,13) Hint: (4035) Mixing signed expressions and longwords gives a 64bit result

I:\Programming\pas-libusb_test_dll\src\libusb.pas(1333,13) Hint: (4035) Mixing signed expressions and longwords gives a 64bit result

(3104) Compiling I:\Programming\pas-libusb_test_dll\src\libusboop.pas

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(275,5) Warning: (3018) Constructor should be public

(3104) Compiling I:\Programming\pas-libusb_test_dll\src\paslibusbutils.pas

I:\Programming\pas-libusb_test_dll\src\paslibusbutils.pas(45,30) Hint: (4080) Converting the operands to "Int64" before doing the subtract could prevent overflow errors.

I:\Programming\pas-libusb_test_dll\src\paslibusbutils.pas(65,44) Hint: (5057) Local variable "PerfCount" does not seem to be initialized

I:\Programming\pas-libusb_test_dll\src\paslibusbutils.pas(70,45) Hint: (5058) Variable "PerfFreq" does not seem to be initialized

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(545,11) Hint: (4055) Conversion between ordinals and pointers is not portable

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(546,11) Hint: (4055) Conversion between ordinals and pointers is not portable

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(564,72) Hint: (4055) Conversion between ordinals and pointers is not portable

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(852,29) Hint: (5057) Local variable "Status" does not seem to be initialized

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(922,18) Hint: (4055) Conversion between ordinals and pointers is not portable

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(923,18) Hint: (4055) Conversion between ordinals and pointers is not portable

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(937,45) Hint: (4055) Conversion between ordinals and pointers is not portable

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(1046,24) Hint: (4055) Conversion between ordinals and pointers is not portable

I:\Programming\pas-libusb_test_dll\src\libusboop.pas(1059,43) Warning: (4056) Conversion between ordinals and pointers is not portable

(9015) Linking .\test1library.exe

Error: Import library not found for libusb-1.0

Fatal: (10026) There were 1 errors compiling module, stopping

Fatal: (1018) Compilation aborted

Error: I:\Programming\FPC\3.0.4\bin\i386-win32\ppc386.exe returned an error exitcode

 

Not sure why it can’t find it now, I renamed libusb-1.0.dll and the new one is right under the one I renamed.

 

James

 

From: fpc-pascal <fpc-pascal-bounces at lists.freepascal.org> On Behalf Of Jean SUZINEAU
Sent: Tuesday, August 6, 2019 11:51 AM
To: fpc-pascal at lists.freepascal.org
Subject: Re: [fpc-pascal] USB Human Interface Devices

 

 

Le 06/08/2019 à 17:18, James Richters a écrit :

 

Any ideas?  Is this just from using i386-win32? Maybe the DLL is only for 64bit? Maybe some completely unrelated issue?  If 64bit is needed, what’s the best way to install FPC3.0.4 for x86_64-win64?  It seems like I tried to do that before and it wasn’t really very easy to try to learn how to compile it.

I'm going to have a look at that. Actually, it seems there's no package for fpc windows 64 bits.

The short answer would be to advise you to download and install lazarus ( https://www.lazarus-ide.org/ ) from https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.4/lazarus-2.0.4-fpc-3.0.4-win64.exe/download

If you install it in C:\lazarus\, you'll end up with a 64 bits fpc in C:\lazarus\fpc\3.0.4\bin\x86_64-win64 . You can run it from command line as usual.

You can also try to replace the libusb-1.0.dll with the one from libusb-1.0.22\MinGW32\dll from https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z .

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190806/4967e560/attachment.html>


More information about the fpc-pascal mailing list