Generating Required Files#
This guide outlines the steps to generate necessary files in this folder using a Windows environment.
Prerequisites#
Windows operating system
Visual Studio 2022 with Visual Studio tools installed
Instructions#
Install Visual Studio 2022 Tools: Ensure that Visual Studio 2022 is installed with the necessary tools for C/C++ development.
Download libusb-1.0 Source Code:
Navigate to the libusb GitHub repository and download the source code for version 1.0.27 as a ZIP file from this link.
Extract the ZIP Archive:
Unzip the downloaded archive to a convenient location on your machine.
Copy Header File:
Locate the
libusb.hfile in the extracted folder atlibusb-1.0.27\libusb.Copy
libusb.hto the folder where you want the generated files to reside.
Open Command Prompt:
Open an “x86 Native Tools Command Prompt for VS 2022”. This can be found in the Start Menu under Visual Studio 2022 Tools.
Build libusb:
Navigate to the
msvcdirectory within the extractedlibusb-1.0.27folder.Execute the following command to build libusb:
msbuild -p:PlatformToolset=v143,Platform=win32,Configuration=Release libusb.sln
This command compiles the libusb solution using the Visual Studio 2022 (v143) toolset for the Win32 platform in Release configuration.
Copy Generated Library:
After the build completes, locate the generated
libusb-1.0.libfile inlibusb-1.0.27\build\v143\Win32\Release\lib.Copy
libusb-1.0.libto the folder where you want the generated files to reside.
Notes#
Ensure that you have administrative rights if you encounter permission issues during these steps.
For any issues related to Visual Studio tools or the build process, refer to the Visual Studio 2022 documentation or the libusb GitHub repository’s issue tracker.