On Linux, the fastest reliable check is ldconfig -p | grep libusb, which lists every libusb library the dynamic linker can see; if you append uname -m or read the path column, you also learn whether what's installed matches your machine's architecture. On macOS, check Homebrew's prefix and the library's Mach-O header, since Apple silicon and Intel builds live in different locations. On Windows, inspect the DLL folders and confirm the PE machine type. The word "architecture" in your question can mean the CPU family (x86-64, ARM64), the bit width (32- vs 64-bit), or the library's own internal "backend" for USB access, so a complete check answers all three.

What "architecture" Means in a libusb Check

Before running anything, decide which question you're actually asking, because the commands differ.

CPU architecture and bit width. libusb is a compiled C library. A binary built for x86-64 (sometimes labeled amd64) won't load into a 32-bit i386 process, and an ARM64 build won't load into an x86-64 process on Apple silicon without translation. On Linux, package managers usually install the right build automatically, but mixed multiarch systems and hand-compiled software routinely produce mismatches. The symptom is a linker error or a runtime "wrong ELF class" message.

Library version. libusb-1.0 and the ancient libusb-0.1 are different ABIs with different headers and symbol names. When people say "is libusb installed," they almost always mean 1.0.x. Checking the version separately from the architecture prevents a lot of confusion.

Backend architecture. libusb-1.0 on Linux talks to the kernel through one of several backends: usbfs/libusb (the native kernel driver interface), udev, or in older builds netlink. The backend affects permissions behavior but not the CPU architecture, so treat it as a separate diagnostic.

Chip architecture, if you're on embedded hardware. On a Raspberry Pi or similar board, "architecture" also matters at the SoC level: whether the userspace is armhf (32-bit ARM) or arm64. A 32-bit Raspberry Pi OS will install armhf libusb, and a 64-bit program can't link against it.

Keep those four meanings in mind; the checks below are grouped so you can answer whichever one you need.

Prerequisite: Identify Your Own Architecture First

You can't compare a library's build to your machine until you know your machine. These commands are stable across distributions, macOS, and Windows shells.

On Linux and macOS:

Typical output is x86_64, aarch64, armv7l, or on macOS arm64. For deeper detail on Linux, uname -a adds the kernel build. For glibc and multiarch specifics, getconf LONG_BIT returns 32 or 64 on most Linux systems, and dpkg --print-architecture (Debian/Ubuntu) or rpm --eval '%{_arch}' (Fedora/RHEL) prints the package-manager's notion of your architecture. On Debian-family systems with multiarch enabled, dpkg --print-foreign-architectures shows additional architectures you've configured.

On macOS, arch prints the architecture of the current shell process, which matters because a terminal can run under Rosetta (x86_64) on an Apple silicon Mac. Compare arch with uname -m to spot that.

On Windows, echo %PROCESSOR_ARCHITECTURE% in cmd.exe returns AMD64, ARM64, or x86. Inside a 32-bit process on 64-bit Windows, %PROCESSOR_ARCHITEW6432% holds the real machine architecture. In PowerShell, [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture gives a clean answer.

Record the result. Every later step compares against it.

Linux: Check Installation and Architecture in One Pass

Linux is where this question most often arises, and the tooling is good.

Step 1: Ask the dynamic linker what it can load. The ldconfig cache lists libraries by soname and path:

A healthy libusb-1.0 install produces lines like libusb-1.0.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libusb-1.0.so.0. The parenthesized tag is the linker's architecture label, and the path usually embeds a multiarch triplet. No output means the linker has no record of libusb: either it isn't installed, or it lives outside the configured library paths. If you see libusb-0.1.so.4, you have only the legacy library.

Step 2: Confirm with the package manager. This distinguishes "not installed" from "installed but invisible."

On Debian-family systems, use the architecture-aware query to see exactly which build is present:

That prints something like libusb-1.0-0:amd64 2:1.0.26-1, which answers version and architecture together. If your system has i386 as a foreign architecture and you see libusb-1.0-0:i386 but no amd64 entry, you know the mismatch before it bites.

Step 3: Verify the file's own architecture. Package metadata can lag behind what's actually on disk, especially after manual copy-installs. Tools that read the ELF header are definitive:

The output names the class (ELF 64-bit or ELF 32-bit), the machine (x86-64, ARM aarch64, ARM, MIPS), and whether it's a shared object. readelf -h on the same file prints Class and Machine as separate header fields; objdump -f prints a shorter summary. If the path from ldconfig doesn't exist, the cache is stale (fixed by running ldconfig as root) or you're on a system where the library was removed after installation.

Step 4: Check development files separately. Runtime libraries and headers are packaged separately. A program compiles only if the development package is present:

On Debian and Ubuntu, the dev package also carries libusb-1.0.so, the unversioned symlink the linker uses at build time; you can verify it with ls -l /usr/lib/x86_64-linux-gnu/libusb-1.0.so.

Step 5: Run a version probe. The library ships a small test program in many packages:

If that binary is absent, compile the canonical version probe in about ten lines: include libusb.h, call libusb_get_version(), print major.minor.micro. Build it with cc probe.c -o probe $(pkg-config --cflags --libs libusb-1.0) and run it. Success proves three things at once: headers exist, the linker found a compatible library, and the loader can load it. pkg-config --modversion libusb-1.0 alone reports the version the build system sees, which is useful in scripts. A failure to link with "skipping incompatible" is the classic architecture mismatch message.

Checking without root or on stripped systems. If ldconfig -p is unavailable or you lack permissions, find / -name 'libusb-1.0.so*' 2>/dev/null locates files directly, and file verifies each one. Container images are a common case: a minimal image may have the runtime library but no headers, no pkg-config metadata, and no ldconfig cache. Running apk add libusb or apt-get install libusb-1.0-0 inside the image, or building with the -dev package in a multi-stage Dockerfile, is the standard fix.

macOS: Homebrew Prefixes Reveal Architecture

Apple's transition from Intel to Apple silicon made the install location the main architecture signal. Homebrew installs Intel builds under /usr/local and ARM builds under /opt/homebrew, so the path practically names the architecture.

Step 1: Check the formula status.

brew info shows the installed version, the prefix, and whether the formula is linked. The prefix field tells you which Homebrew tree is serving the library. On an Apple silicon Mac, /opt/homebrew/Cellar/libusb/... means an ARM64 build; /usr/local/Cellar/libusb/... means an Intel build.

Step 2: Confirm the file's architecture. file on macOS reads Mach-O headers and prints the CPU type and subtype:

A universal binary reports Mach-O universal binary with 2 architectures and lists both; a single-architecture build names only one. You can also use lipo -archs on the same file to print a terse list.

Step 3: Check the linker search path for your build. pkg-config --libs libusb-1.0 should print include and library flags that point at the same prefix. If your shell is running under Rosetta and you set up a build with an ARM Homebrew, those two won't agree. arch and uname -m in the same shell settle it: both should read the same value, and a universal binary can satisfy either.

Step 4: For systems without Homebrew. The library may have been installed by MacPorts (typically /opt/local) or built from source into /usr/local. find / -name 'libusb-1.0*.dylib' 2>/dev/null finds candidates, and file classifies them. Header presence at the same prefix confirms the development files.

Windows: Find the DLL and Read Its PE Header

Windows has no ldconfig and no package-manager query that speaks for every application. You check files.

Step 1: Locate the DLL. libusb-1.0 ships as libusb-1.0.dll, commonly paired with libusb-1.0.lib (an import library) and libusb.h. Search the usual suspects:

That could be slow across a whole drive; narrower searches inside the folders you expect—the application directory, C:\Windows\System32, a bin folder under an SDK or toolchain—are usually enough. In PowerShell, Get-ChildItem -Path C:\ -Filter libusb-1.0.dll -Recurse -ErrorAction SilentlyContinue does the same with cleaner filtering. Python users can check import usb-style wrapper packages (for example pyusb) and inspect whether the backend you rely on finds a library.

Step 2: Read the PE machine type. A clean one-liner in PowerShell 5.1 or later computes it from the file header:

8664 means x64, 014C means x86, AA64 means ARM64, and 01C4 means ARM (32-bit). If you'd rather not fuss with byte offsets, the free Sysinternals sigcheck -a tool prints machine type and version fields, and corflags reads managed assemblies only, so it doesn't apply here. Development headers and import libraries are the other half: a program only builds if libusb.h and libusb-1.0.lib are on the compiler's search path, and the import library's machine type must match the header's calling conventions (Windows x64 uses different calling conventions from x86, so the two cannot be mixed).

Step 3: Watch for bitness traps that don't come from libusb. The most common "installed but unusable" case on Windows is a 32-bit process loading a 64-bit DLL, or the reverse, through different search paths. A 32-bit application looks in SysWOW64 for libraries, and there's no silent remapping for a DLL you ship beside the executable. If you call libusb from a 32-bit program, install a 32-bit build. Package managers such as vcpkg and MSYS2 keep architecture-tagged trees; select the matching triplet.

Match Architecture to the Software That Will Use It

A library is "installed" for your purposes only if the process that needs it can load it. Three conditions must hold simultaneously, and each has a different failure mode.

CPU family and width match. An ELF or PE of the wrong class fails to load, with a message naming the loader, the file, and a phrase like "wrong ELF class," "cannot execute binary file," or "the specified module could not be found" on Windows when the loader quietly skips the mismatch.

Version and ABI match. A build against libusb-1.0.x headers needs a runtime from the same major series. The version field in libusb_get_version() lets you log this at startup; compare major and minor to what you compiled against rather than assuming.

Loader path match. A library can be present but invisible to the loader: outside ld.so.conf on Linux, outside the DYLD_* fallback paths on macOS, or not on PATH or beside the executable on Windows. The native version probe fails to link or to start, and the fix is a search-path entry, not another install.

A worked example: a developer on Ubuntu 24.04 with multiarch enabled installs libusb-1.0-0-dev:i386 because a vendor SDK shipped 32-bit. Running ldconfig -p | grep libusb shows both libc6,x86-64 and libc6 tags. If a 64-bit build now fails at the link step with "skipping incompatible," the build is picking up the i386 .so first; correcting the include and library flags to the multiarch paths resolves it. Nothing was missing—the architecture was.

For embedded Linux, substitute the distro query with the platform's own: on Raspberry Pi OS, apt list --installed | grep libusb combined with dpkg --print-architecture distinguishes armhf from arm64 in one step, and file on the installed .so under /usr/lib/arm-linux-gnueabihf or /usr/lib/aarch64-linux-gnu confirms.

Troubleshooting Failed Checks

Symptoms point to causes; try reversible checks first.

No output from ldconfig -p. Either libusb isn't installed, or the cache is stale. Run ldconfig -v | grep libusb as root to see whether the library is being scanned at all, then install if it isn't. This is safe and reversible.

"Wrong ELF class" on a Linux program that compiled. The compiler found one build and the loader found another, or the program's own bit width differs from the library's. Use file on both the executable and the library; they must agree on class and machine. Fix by reinstalling the matching package triplet or adjusting the build flags.

Homebrew reports the formula installed but the linker can't find it. The formula may be installed but unlinked (brew link libusb), or your build is relying on a different Homebrew prefix. brew info and pkg-config output together reveal which tree is active.

Windows: the DLL is there but the app reports it missing. Almost always a bitness or directory mismatch. Verify the PE machine type on both the DLL and the executable; a 32-bit app can't load a 64-bit DLL. Also confirm whether the app expects the DLL under its own folder rather than System32; modern practice is to ship it beside the binary.

Python or Java bindings fail while system tools work. Wrappers often load the library through ctypes or JNI from an interpreter with its own architecture. Check the interpreter's bit width with a language-specific command, then point the wrapper at a matching library path, often via an environment variable or configuration key the wrapper documents.

Stop and involve a packaging or systems specialist if you're chasing mismatches inside a build system's caches, on a production image with unclear provenance, or when architecture corrections conflict with security requirements. Reinstalling packages at scale based on a single failed probe isn't worth it; get a second independent check first.

Quick Verification Recipes and the Short Answer

For most people, one test settles it:

Ubuntu/Debian: dpkg-query -W -f='${Package} ${Architecture} ${Version}\n' 'libusb-1.0-0*' plus ldconfig -p | grep libusb. Matching architecture tags and a version entry mean installed and usable by matching processes. macOS: brew info libusb and file on the dylib at the reported prefix. The prefix (− /opt/homebrew vs /usr/local) names the architecture. Windows: where /r for the DLL and the PE machine type one-liner; compare with how your application was built.

Success looks like: the library appears in a package-manager or Homebrew query, file or the PE header reports the same architecture as your machine and your target process, the development files (headers and import library or .so symlink) sit at the same prefix, and a trivial version probe builds and runs. If any of those four checks fails, the fix is specific: install the runtime package, install the development package, adjust the build flags, or address the bitness mismatch. Confirm by re-running the probe, not by re-reading the system summary, because the probe reflects the loader's view rather than your shell history's.